@@ -629,15 +629,6 @@ static BaseType_t prvCreateIdleTasks( void );
629
629
static void prvCheckForRunStateChange ( void );
630
630
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
631
631
632
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
633
-
634
- /*
635
- * Checks to see if another task moved the current task out of the ready
636
- * list while it was waiting to enter a lightweight critical section and yields, if so.
637
- */
638
- static void prvLightWeightCheckForRunStateChange ( void );
639
- #endif /* #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 ) */
640
-
641
632
#if ( configNUMBER_OF_CORES > 1 )
642
633
643
634
/*
@@ -976,67 +967,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
976
967
977
968
/*-----------------------------------------------------------*/
978
969
979
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
980
- static void prvLightWeightCheckForRunStateChange ( void )
981
- {
982
- const TCB_t * pxThisTCB ;
983
- BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID ();
984
-
985
- /* This must only be called from within a task. */
986
- portASSERT_IF_IN_ISR ();
987
-
988
- /* This function is always called with interrupts disabled
989
- * so this is safe. */
990
- pxThisTCB = pxCurrentTCBs [ xCoreID ];
991
-
992
- while ( pxThisTCB -> xTaskRunState == taskTASK_SCHEDULED_TO_YIELD )
993
- {
994
- UBaseType_t uxPrevCriticalNesting ;
995
-
996
- /* We are only here if we just entered a critical section
997
- * or if we just suspended the scheduler, and another task
998
- * has requested that we yield.
999
- *
1000
- * This is slightly complicated since we need to save and restore
1001
- * the suspension and critical nesting counts, as well as release
1002
- * and reacquire the correct locks. And then, do it all over again
1003
- * if our state changed again during the reacquisition. */
1004
- uxPrevCriticalNesting = portGET_CRITICAL_NESTING_COUNT ( xCoreID );
1005
-
1006
- if ( uxPrevCriticalNesting > 0U )
1007
- {
1008
- portSET_CRITICAL_NESTING_COUNT ( xCoreID , 0U );
1009
- kernelRELEASE_ISR_LOCK ( xCoreID );
1010
- }
1011
- else
1012
- {
1013
- /* The scheduler is suspended. uxSchedulerSuspended is updated
1014
- * only when the task is not requested to yield. */
1015
- mtCOVERAGE_TEST_MARKER ();
1016
- }
1017
-
1018
- portMEMORY_BARRIER ();
1019
-
1020
- portENABLE_INTERRUPTS ();
1021
-
1022
- /* Enabling interrupts should cause this core to immediately service
1023
- * the pending interrupt and yield. After servicing the pending interrupt,
1024
- * the task needs to re-evaluate its run state within this loop, as
1025
- * other cores may have requested this task to yield, potentially altering
1026
- * its run state. */
1027
-
1028
- portDISABLE_INTERRUPTS ();
1029
-
1030
- xCoreID = ( BaseType_t ) portGET_CORE_ID ();
1031
- kernelGET_ISR_LOCK ( xCoreID );
1032
-
1033
- portSET_CRITICAL_NESTING_COUNT ( xCoreID , uxPrevCriticalNesting );
1034
- }
1035
- }
1036
- #endif /* #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 ) */
1037
-
1038
- /*-----------------------------------------------------------*/
1039
-
1040
970
#if ( configNUMBER_OF_CORES > 1 )
1041
971
static void prvYieldForTask ( const TCB_t * pxTCB )
1042
972
{
@@ -3342,11 +3272,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
3342
3272
3343
3273
traceENTER_vTaskPreemptionDisable ( xTask );
3344
3274
3345
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3346
- vKernelLightWeightEnterCritical ();
3347
- #else
3348
- kernelENTER_CRITICAL ();
3349
- #endif
3275
+ kernelENTER_CRITICAL ();
3350
3276
{
3351
3277
if ( xSchedulerRunning != pdFALSE )
3352
3278
{
@@ -3360,11 +3286,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
3360
3286
mtCOVERAGE_TEST_MARKER ();
3361
3287
}
3362
3288
}
3363
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3364
- vKernelLightWeightExitCritical ();
3365
- #else
3366
- kernelEXIT_CRITICAL ();
3367
- #endif
3289
+ kernelEXIT_CRITICAL ();
3368
3290
3369
3291
traceRETURN_vTaskPreemptionDisable ();
3370
3292
}
@@ -3380,11 +3302,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
3380
3302
UBaseType_t uxDeferredAction = 0U ;
3381
3303
BaseType_t xAlreadyYielded = pdFALSE ;
3382
3304
3383
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3384
- vKernelLightWeightEnterCritical ();
3385
- #else
3386
- kernelENTER_CRITICAL ();
3387
- #endif
3305
+ kernelENTER_CRITICAL ();
3388
3306
{
3389
3307
if ( xSchedulerRunning != pdFALSE )
3390
3308
{
@@ -3423,11 +3341,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
3423
3341
mtCOVERAGE_TEST_MARKER ();
3424
3342
}
3425
3343
}
3426
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
3427
- vKernelLightWeightExitCritical ();
3428
- #else
3429
- kernelEXIT_CRITICAL ();
3430
- #endif
3344
+ kernelEXIT_CRITICAL ();
3431
3345
3432
3346
if ( uxDeferredAction != 0U )
3433
3347
{
@@ -7848,80 +7762,6 @@ static void prvResetNextTaskUnblockTime( void )
7848
7762
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
7849
7763
/*-----------------------------------------------------------*/
7850
7764
7851
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
7852
-
7853
- void vKernelLightWeightEnterCritical ( void )
7854
- {
7855
- if ( xSchedulerRunning != pdFALSE )
7856
- {
7857
- portDISABLE_INTERRUPTS ();
7858
- {
7859
- const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID ();
7860
-
7861
- /* Get only the ISR lock, not the task lock */
7862
- kernelGET_ISR_LOCK ( xCoreID );
7863
-
7864
- portINCREMENT_CRITICAL_NESTING_COUNT ( xCoreID );
7865
-
7866
- if ( portGET_CRITICAL_NESTING_COUNT ( xCoreID ) == 1U )
7867
- {
7868
- prvLightWeightCheckForRunStateChange ();
7869
- }
7870
- }
7871
- }
7872
- }
7873
-
7874
- #endif /* #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 ) */
7875
- /*-----------------------------------------------------------*/
7876
-
7877
- #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 )
7878
-
7879
- void vKernelLightWeightExitCritical ( void )
7880
- {
7881
- if ( xSchedulerRunning != pdFALSE )
7882
- {
7883
- const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID ();
7884
-
7885
- if ( portGET_CRITICAL_NESTING_COUNT ( xCoreID ) > 0U )
7886
- {
7887
- BaseType_t xYieldCurrentTask ;
7888
-
7889
- if ( ( xYieldPendings [ xCoreID ] == pdTRUE ) && ( uxSchedulerSuspended == pdFALSE )
7890
- #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
7891
- && ( pxCurrentTCBs [ xCoreID ]-> uxPreemptionDisable == 0U ) &&
7892
- ( pxCurrentTCBs [ xCoreID ]-> uxDeferredStateChange == 0U )
7893
- #endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
7894
- )
7895
- {
7896
- xYieldCurrentTask = pdTRUE ;
7897
- }
7898
- else
7899
- {
7900
- xYieldCurrentTask = pdFALSE ;
7901
- }
7902
-
7903
- /* Release the ISR lock */
7904
- kernelRELEASE_ISR_LOCK ( xCoreID );
7905
-
7906
- portDECREMENT_CRITICAL_NESTING_COUNT ( xCoreID );
7907
-
7908
- /* If the critical nesting count is 0, enable interrupts */
7909
- if ( portGET_CRITICAL_NESTING_COUNT ( xCoreID ) == 0U )
7910
- {
7911
- portENABLE_INTERRUPTS ();
7912
-
7913
- if ( xYieldCurrentTask != pdFALSE )
7914
- {
7915
- portYIELD ();
7916
- }
7917
- }
7918
- }
7919
- }
7920
- }
7921
-
7922
- #endif /* #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 ) */
7923
- /*-----------------------------------------------------------*/
7924
-
7925
7765
#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
7926
7766
7927
7767
static char * prvWriteNameToBuffer ( char * pcBuffer ,
0 commit comments