Not using pxIndex to iterate ready list in trace utility (#1000)
* pxIndex should only be used when selecting next task. Altering pxIndex of a ready list will cause the scheduler to be unable to select the right task to run. Using a for loop if traversing the list for trace utility is required. * Not defining listGET_OWNER_OF_NEXT_ENTRY when using SMP scheduler --------- Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
@ -282,7 +282,8 @@ typedef struct xLIST
|
||||
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
||||
* \ingroup LinkedList
|
||||
*/
|
||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||
#if ( configNUMBER_OF_CORES == 1 )
|
||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||
do { \
|
||||
List_t * const pxConstList = ( pxList ); \
|
||||
/* Increment the index to the next item and return the item, ensuring */ \
|
||||
@ -294,6 +295,13 @@ typedef struct xLIST
|
||||
} \
|
||||
( pxTCB ) = ( pxConstList )->pxIndex->pvOwner; \
|
||||
} while( 0 )
|
||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||
|
||||
/* This function is not required in SMP. FreeRTOS SMP scheduler doesn't use
|
||||
* pxIndex and it should always point to the xListEnd. Not defining this macro
|
||||
* here to prevent updating pxIndex.
|
||||
*/
|
||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||
|
||||
/*
|
||||
* Version of uxListRemove() that does not return a value. Provided as a slight
|
||||
|
Reference in New Issue
Block a user