]> git.sur5r.net Git - freertos/commitdiff
Add in a separate uxTaskNumber to the TCB structure for use by trace tools, leaving...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 30 Nov 2011 09:53:11 +0000 (09:53 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 30 Nov 2011 09:53:11 +0000 (09:53 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1646 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/tasks.c

index 7950bf49f514aa48cb41540a17493c48b1737985..91b749bf1502421a21d5e82de97563aaea5d517e 100644 (file)
@@ -100,7 +100,8 @@ typedef struct tskTaskControlBlock
        #endif\r
 \r
        #if ( configUSE_TRACE_FACILITY == 1 )\r
-               unsigned portBASE_TYPE  uxTCBNumber;    /*< This is used for tracing the scheduler and making debugging easier only. */\r
+               unsigned portBASE_TYPE  uxTCBNumber;    /*< This stores a number that increments each time a TCB is created.  It allows debuggers to determine when a task has been deleted and then recreated. */\r
+               unsigned portBASE_TYPE  uxTaskNumber;   /*< This stores a number specifically for use by third party trace code. */\r
        #endif\r
 \r
        #if ( configUSE_MUTEXES == 1 )\r
@@ -167,7 +168,7 @@ PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxSchedulerSuspended         =
 PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxMissedTicks                   = ( unsigned portBASE_TYPE ) 0U;\r
 PRIVILEGED_DATA static volatile portBASE_TYPE xMissedYield                                             = ( portBASE_TYPE ) pdFALSE;\r
 PRIVILEGED_DATA static volatile portBASE_TYPE xNumOfOverflows                                  = ( portBASE_TYPE ) 0;\r
-PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber                                             = ( unsigned portBASE_TYPE ) 0U;\r
+PRIVILEGED_DATA static unsigned portBASE_TYPE uxTCBNumber                                              = ( unsigned portBASE_TYPE ) 0U;\r
 PRIVILEGED_DATA static portTickType xNextTaskUnblockTime                                               = ( portTickType ) portMAX_DELAY;\r
 \r
 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
@@ -505,10 +506,10 @@ tskTCB * pxNewTCB;
                        #if ( configUSE_TRACE_FACILITY == 1 )\r
                        {\r
                                /* Add a counter into the TCB for tracing only. */\r
-                               pxNewTCB->uxTCBNumber = uxTaskNumber;\r
+                               pxNewTCB->uxTCBNumber = uxTCBNumber;\r
                        }\r
                        #endif\r
-                       uxTaskNumber++;\r
+                       uxTCBNumber++;\r
 \r
                        prvAddTaskToReadyQueue( pxNewTCB );\r
 \r
@@ -579,7 +580,7 @@ tskTCB * pxNewTCB;
 \r
                        /* Increment the uxTaskNumberVariable also so kernel aware debuggers\r
                        can detect that the task lists need re-generating. */\r
-                       uxTaskNumber++;\r
+                       uxTCBNumber++;\r
 \r
                        traceTASK_DELETE( pxTCB );\r
                }\r
@@ -1830,7 +1831,7 @@ void vTaskMissedYield( void )
                if( xTask != NULL )\r
                {\r
                        pxTCB = ( tskTCB * ) xTask;\r
-                       uxReturn = pxTCB->uxTCBNumber;\r
+                       uxReturn = pxTCB->uxTaskNumber;\r
                }\r
                else\r
                {\r
@@ -1850,7 +1851,7 @@ void vTaskMissedYield( void )
                if( xTask != NULL )\r
                {\r
                        pxTCB = ( tskTCB * ) xTask;\r
-                       pxTCB->uxTCBNumber = uxHandle;\r
+                       pxTCB->uxTaskNumber = uxHandle;\r
                }\r
        }\r
 #endif\r