From a7593d42e297d4475d15ccba6649e90b69bd8298 Mon Sep 17 00:00:00 2001 From: ReservedField Date: Mon, 24 Oct 2016 19:05:27 +0200 Subject: [PATCH] Make Thread_CriticalEnter/Exit no-ops from startup code --- src/thread/Thread.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/thread/Thread.c b/src/thread/Thread.c index 07e4fc1..8bf2846 100644 --- a/src/thread/Thread.c +++ b/src/thread/Thread.c @@ -572,13 +572,6 @@ static void Thread_ExitProc(void *ret) { void Thread_Init() { Queue_Init(&Thread_readyQueue); Queue_Init(&Thread_chronoQueue); - Thread_curTcb = NULL; -#ifdef EVICSDK_FPU_SUPPORT - Thread_fpuState.holderCtx = NULL; - Thread_fpuState.curCtx = NULL; -#endif - Thread_criticalCount = 0; - Thread_sysTick = 0; // Configure MPU for stack guard MPU->CTRL = @@ -722,8 +715,8 @@ void Thread_DelayMs(uint32_t delay) { } void Thread_CriticalEnter() { - // For internal use only: no-op from ISRs. - if(THREAD_GET_IRQN() != 0) { + // For internal use only: no-op from ISRs or startup code. + if(THREAD_GET_IRQN() != 0 || Thread_curTcb == NULL) { return; } @@ -738,8 +731,8 @@ void Thread_CriticalEnter() { } void Thread_CriticalExit() { - // For internal use only: no-op from ISRs. - if(THREAD_GET_IRQN() != 0) { + // For internal use only: no-op from ISRs or startup code. + if(THREAD_GET_IRQN() != 0 || Thread_curTcb == NULL) { return; }