Skip to content

Commit

Permalink
Make Thread_CriticalEnter/Exit no-ops from startup code
Browse files Browse the repository at this point in the history
  • Loading branch information
ReservedField committed Oct 24, 2016
1 parent 1a214f7 commit a7593d4
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/thread/Thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit a7593d4

Please sign in to comment.