From 7e07871a583c7e5e13d834d7ffca552b16a65c7d Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Tue, 27 Feb 2024 10:39:26 +0800 Subject: [PATCH] Not defining listGET_OWNER_OF_NEXT_ENTRY when using SMP scheduler --- include/list.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/list.h b/include/list.h index a9aace44e..41d56b54e 100644 --- a/include/list.h +++ b/include/list.h @@ -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 points 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