Added traceMOVED_TASK_TO_READY_STATE and portSETUP_TCB macros.

Changed uxTCBNumber back to uxTaskNumber in tasks.c to fix IAR plug-in.
pull/1/head
Richard Barry 13 years ago
parent c0339c2c86
commit 1312fada7c

@ -234,6 +234,10 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
#define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
#endif #endif
#ifndef portSETUP_TCB
#define portSETUP_TCB( pxTCB ) ( void ) pxTCB
#endif
#ifndef configQUEUE_REGISTRY_SIZE #ifndef configQUEUE_REGISTRY_SIZE
#define configQUEUE_REGISTRY_SIZE 0U #define configQUEUE_REGISTRY_SIZE 0U
#endif #endif
@ -311,6 +315,10 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
/* The following event macros are embedded in the kernel API calls. */ /* The following event macros are embedded in the kernel API calls. */
#ifndef traceMOVED_TASK_TO_READY_STATE
#define traceMOVED_TASK_TO_READY_STATE( pxTCB )
#endif
#ifndef traceQUEUE_CREATE #ifndef traceQUEUE_CREATE
#define traceQUEUE_CREATE( pxNewQueue ) #define traceQUEUE_CREATE( pxNewQueue )
#endif #endif

@ -168,7 +168,7 @@ PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxSchedulerSuspended =
PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxMissedTicks = ( unsigned portBASE_TYPE ) 0U; PRIVILEGED_DATA static volatile unsigned portBASE_TYPE uxMissedTicks = ( unsigned portBASE_TYPE ) 0U;
PRIVILEGED_DATA static volatile portBASE_TYPE xMissedYield = ( portBASE_TYPE ) pdFALSE; PRIVILEGED_DATA static volatile portBASE_TYPE xMissedYield = ( portBASE_TYPE ) pdFALSE;
PRIVILEGED_DATA static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0; PRIVILEGED_DATA static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0;
PRIVILEGED_DATA static unsigned portBASE_TYPE uxTCBNumber = ( unsigned portBASE_TYPE ) 0U; PRIVILEGED_DATA static unsigned portBASE_TYPE uxTaskNumber = ( unsigned portBASE_TYPE ) 0U;
PRIVILEGED_DATA static portTickType xNextTaskUnblockTime = ( portTickType ) portMAX_DELAY; PRIVILEGED_DATA static portTickType xNextTaskUnblockTime = ( portTickType ) portMAX_DELAY;
#if ( configGENERATE_RUN_TIME_STATS == 1 ) #if ( configGENERATE_RUN_TIME_STATS == 1 )
@ -205,6 +205,7 @@ PRIVILEGED_DATA static portTickType xNextTaskUnblockTime = ( portTickType )
* executing task has been rescheduled. * executing task has been rescheduled.
*/ */
#define prvAddTaskToReadyQueue( pxTCB ) \ #define prvAddTaskToReadyQueue( pxTCB ) \
traceMOVED_TASK_TO_READY_STATE( pxTCB ) \
if( ( pxTCB )->uxPriority > uxTopReadyPriority ) \ if( ( pxTCB )->uxPriority > uxTopReadyPriority ) \
{ \ { \
uxTopReadyPriority = ( pxTCB )->uxPriority; \ uxTopReadyPriority = ( pxTCB )->uxPriority; \
@ -506,14 +507,15 @@ tskTCB * pxNewTCB;
#if ( configUSE_TRACE_FACILITY == 1 ) #if ( configUSE_TRACE_FACILITY == 1 )
{ {
/* Add a counter into the TCB for tracing only. */ /* Add a counter into the TCB for tracing only. */
pxNewTCB->uxTCBNumber = uxTCBNumber; pxNewTCB->uxTCBNumber = uxTaskNumber;
} }
#endif #endif
uxTCBNumber++; uxTaskNumber++;
prvAddTaskToReadyQueue( pxNewTCB ); prvAddTaskToReadyQueue( pxNewTCB );
xReturn = pdPASS; xReturn = pdPASS;
portSETUP_TCB( pxNewTCB );
traceTASK_CREATE( pxNewTCB ); traceTASK_CREATE( pxNewTCB );
} }
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();
@ -580,7 +582,7 @@ tskTCB * pxNewTCB;
/* Increment the uxTaskNumberVariable also so kernel aware debuggers /* Increment the uxTaskNumberVariable also so kernel aware debuggers
can detect that the task lists need re-generating. */ can detect that the task lists need re-generating. */
uxTCBNumber++; uxTaskNumber++;
traceTASK_DELETE( pxTCB ); traceTASK_DELETE( pxTCB );
} }
@ -2300,7 +2302,8 @@ tskTCB *pxNewTCB;
static void prvDeleteTCB( tskTCB *pxTCB ) static void prvDeleteTCB( tskTCB *pxTCB )
{ {
/* This call is required specifically for the TriCore port. It must be /* This call is required specifically for the TriCore port. It must be
above the vPortFree() calls. */ above the vPortFree() calls. The call is also used by ports/demos that
want to allocate and clean RAM statically. */
portCLEAN_UP_TCB( pxTCB ); portCLEAN_UP_TCB( pxTCB );
/* Free up the memory allocated by the scheduler for the task. It is up to /* Free up the memory allocated by the scheduler for the task. It is up to

Loading…
Cancel
Save