feat(freertos-smp): Use light weight locks for preemption disable/enable

This commit is contained in:
Sudeep Mohanty 2025-08-22 17:12:08 +02:00
parent f46aaa7a2b
commit 49b89b2f25

24
tasks.c
View file

@ -3286,7 +3286,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
traceENTER_vTaskPreemptionDisable( xTask ); traceENTER_vTaskPreemptionDisable( xTask );
kernelENTER_CRITICAL(); #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
vKernelLightWeightEnterCritical();
#else
kernelENTER_CRITICAL();
#endif
{ {
if( xSchedulerRunning != pdFALSE ) if( xSchedulerRunning != pdFALSE )
{ {
@ -3300,7 +3304,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
} }
kernelEXIT_CRITICAL(); #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
vKernelLightWeightExitCritical();
#else
kernelEXIT_CRITICAL();
#endif
traceRETURN_vTaskPreemptionDisable(); traceRETURN_vTaskPreemptionDisable();
} }
@ -3316,7 +3324,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
UBaseType_t uxDeferredAction = 0U; UBaseType_t uxDeferredAction = 0U;
BaseType_t xAlreadyYielded = pdFALSE; BaseType_t xAlreadyYielded = pdFALSE;
kernelENTER_CRITICAL(); #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
vKernelLightWeightEnterCritical();
#else
kernelENTER_CRITICAL();
#endif
{ {
if( xSchedulerRunning != pdFALSE ) if( xSchedulerRunning != pdFALSE )
{ {
@ -3355,7 +3367,11 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
} }
kernelEXIT_CRITICAL(); #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
vKernelLightWeightExitCritical();
#else
kernelEXIT_CRITICAL();
#endif
if( uxDeferredAction != 0U ) if( uxDeferredAction != 0U )
{ {