File tree Expand file tree Collapse file tree 1 file changed +14
-24
lines changed Expand file tree Collapse file tree 1 file changed +14
-24
lines changed Original file line number Diff line number Diff line change @@ -2108,29 +2108,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
2108
2108
mtCOVERAGE_TEST_MARKER ();
2109
2109
}
2110
2110
2111
- if ( ( pxNewTCB -> uxTaskAttributes & taskATTRIBUTE_IS_IDLE ) != 0U )
2112
- {
2113
- BaseType_t xCoreID ;
2114
-
2115
- /* Check if a core is free. */
2116
- for ( xCoreID = ( BaseType_t ) 0 ; xCoreID < ( BaseType_t ) configNUMBER_OF_CORES ; xCoreID ++ )
2117
- {
2118
- if ( pxCurrentTCBs [ xCoreID ] == NULL )
2119
- {
2120
- pxNewTCB -> xTaskRunState = xCoreID ;
2121
- pxCurrentTCBs [ xCoreID ] = pxNewTCB ;
2122
- break ;
2123
- }
2124
- else
2125
- {
2126
- mtCOVERAGE_TEST_MARKER ();
2127
- }
2128
- }
2129
- }
2130
- else
2131
- {
2132
- mtCOVERAGE_TEST_MARKER ();
2133
- }
2111
+ /* All the cores start with idle tasks before the SMP scheduler
2112
+ * is running. Idle tasks are assigned to cores when they are
2113
+ * created in prvCreateIdleTasks(). */
2134
2114
}
2135
2115
2136
2116
uxTaskNumber ++ ;
@@ -3645,7 +3625,17 @@ static BaseType_t prvCreateIdleTasks( void )
3645
3625
}
3646
3626
else
3647
3627
{
3648
- mtCOVERAGE_TEST_MARKER ();
3628
+ #if ( configNUMBER_OF_CORES == 1 )
3629
+ {
3630
+ mtCOVERAGE_TEST_MARKER ();
3631
+ }
3632
+ #else
3633
+ {
3634
+ /* Assign idle task to each core before SMP scheduler is running. */
3635
+ xIdleTaskHandles [ xCoreID ]-> xTaskRunState = xCoreID ;
3636
+ pxCurrentTCBs [ xCoreID ] = xIdleTaskHandles [ xCoreID ];
3637
+ }
3638
+ #endif
3649
3639
}
3650
3640
}
3651
3641
You can’t perform that action at this time.
0 commit comments