Skip to content

Commit 49b89b2

Browse files
feat(freertos-smp): Use light weight locks for preemption disable/enable
1 parent f46aaa7 commit 49b89b2

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

tasks.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3286,7 +3286,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
32863286

32873287
traceENTER_vTaskPreemptionDisable( xTask );
32883288

3289-
kernelENTER_CRITICAL();
3289+
#if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3290+
vKernelLightWeightEnterCritical();
3291+
#else
3292+
kernelENTER_CRITICAL();
3293+
#endif
32903294
{
32913295
if( xSchedulerRunning != pdFALSE )
32923296
{
@@ -3300,7 +3304,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
33003304
mtCOVERAGE_TEST_MARKER();
33013305
}
33023306
}
3303-
kernelEXIT_CRITICAL();
3307+
#if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3308+
vKernelLightWeightExitCritical();
3309+
#else
3310+
kernelEXIT_CRITICAL();
3311+
#endif
33043312

33053313
traceRETURN_vTaskPreemptionDisable();
33063314
}
@@ -3316,7 +3324,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
33163324
UBaseType_t uxDeferredAction = 0U;
33173325
BaseType_t xAlreadyYielded = pdFALSE;
33183326

3319-
kernelENTER_CRITICAL();
3327+
#if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3328+
vKernelLightWeightEnterCritical();
3329+
#else
3330+
kernelENTER_CRITICAL();
3331+
#endif
33203332
{
33213333
if( xSchedulerRunning != pdFALSE )
33223334
{
@@ -3355,7 +3367,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
33553367
mtCOVERAGE_TEST_MARKER();
33563368
}
33573369
}
3358-
kernelEXIT_CRITICAL();
3370+
#if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3371+
vKernelLightWeightExitCritical();
3372+
#else
3373+
kernelEXIT_CRITICAL();
3374+
#endif
33593375

33603376
if( uxDeferredAction != 0U )
33613377
{

0 commit comments

Comments
 (0)