]> git.sur5r.net Git - freertos/commitdiff
Remove obsolete code from prvCheckTasksWaitingTermination().
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 29 May 2017 22:55:09 +0000 (22:55 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 29 May 2017 22:55:09 +0000 (22:55 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2509 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Demo/Common/Minimal/death.c
FreeRTOS/Source/tasks.c

index bc1238647b7b8ee423e63fa03a672fe60b86ab3c..4c28e3716d47e309e3f7bcb1e60af72d0511ebc8 100644 (file)
@@ -159,6 +159,9 @@ volatile long l1, l2;
 TaskHandle_t xTaskToKill;\r
 const TickType_t xDelay = pdMS_TO_TICKS( ( TickType_t ) 200 );\r
 \r
+       /* Test deletion of a task's secure context, if any. */\r
+       portTASK_CALLS_SECURE_FUNCTIONS();\r
+\r
        if( pvParameters != NULL )\r
        {\r
                /* This task is periodically created four times.  Two created tasks are\r
index 460f4bf3cd899fade3708b011cf7adbf4a77a925..ed4851fd6f58349981ba73a850ebc5ca1384bde8 100644 (file)
@@ -3265,6 +3265,11 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
        /** 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
@@ -3503,37 +3508,22 @@ static void prvCheckTasksWaitingTermination( void )
 \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
@@ -3763,7 +3753,7 @@ static void prvCheckTasksWaitingTermination( void )
                        {\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