/** THIS IS THE RTOS IDLE TASK - WHICH IS CREATED AUTOMATICALLY WHEN THE\r
SCHEDULER IS STARTED. **/\r
\r
+ /* In case a task that has a secure context deletes itself, in which case\r
+ the idle task is responsible for deleting the task's secure context, if\r
+ any. */\r
+ portTASK_CALLS_SECURE_FUNCTIONS();\r
+ \r
for( ;; )\r
{\r
/* See if any tasks have deleted themselves - if so then the idle task\r
\r
#if ( INCLUDE_vTaskDelete == 1 )\r
{\r
- BaseType_t xListIsEmpty;\r
+ TCB_t *pxTCB;\r
\r
- /* ucTasksDeleted is used to prevent vTaskSuspendAll() being called\r
- too often in the idle task. */\r
+ /* uxDeletedTasksWaitingCleanUp is used to prevent vTaskSuspendAll()\r
+ being called too often in the idle task. */\r
while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )\r
{\r
- vTaskSuspendAll();\r
+ taskENTER_CRITICAL();\r
{\r
- xListIsEmpty = listLIST_IS_EMPTY( &xTasksWaitingTermination );\r
+ pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );\r
+ ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
+ --uxCurrentNumberOfTasks;\r
+ --uxDeletedTasksWaitingCleanUp;\r
}\r
- ( void ) xTaskResumeAll();\r
-\r
- if( xListIsEmpty == pdFALSE )\r
- {\r
- TCB_t *pxTCB;\r
-\r
- taskENTER_CRITICAL();\r
- {\r
- pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );\r
- ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
- --uxCurrentNumberOfTasks;\r
- --uxDeletedTasksWaitingCleanUp;\r
- }\r
- taskEXIT_CRITICAL();\r
+ taskEXIT_CRITICAL();\r
\r
- prvDeleteTCB( pxTCB );\r
- }\r
- else\r
- {\r
- mtCOVERAGE_TEST_MARKER();\r
- }\r
+ prvDeleteTCB( pxTCB );\r
}\r
}\r
#endif /* INCLUDE_vTaskDelete */\r
{\r
/* Neither the stack nor the TCB were allocated dynamically, so\r
nothing needs to be freed. */\r
- configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )\r
+ configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB );\r
mtCOVERAGE_TEST_MARKER();\r
}\r
}\r