change(freertos/idf): Remove xCoreID TCB member for single-core

This commit does the following:

- removes the xCoreID member from the TCB when building for single-core
- xCoreID is no longer hard set to 0 when calling "PinnedToCore" task creation
functions in single-core
- Tidy up or add missing xCoreID asserts for functions that take xCoreID as an
argument:
    - Functions that set/query a variable of a particular core will call
      taskVALID_CORE_ID() to ensure ) 0 <= xCoreID < configNUMBER_OF_CORES
    - Task creation functions that accept xCoreID also call taskVALID_CORE_ID()
      but also allow tskNO_AFFINITY.
- Fix TaskStatus_t
    - Remove xCoreID from TaskStatus_t if configTASKLIST_INCLUDE_COREID is not
      defined.
    - Set xCoreID to 0 when calling vTaskGetInfo() in single-core builds
This commit is contained in:
Darian Leung
2023-11-16 19:41:24 +08:00
parent ae2bd61054
commit 439c7c4261
10 changed files with 99 additions and 41 deletions

View File

@@ -1289,8 +1289,9 @@ typedef struct xSTATIC_TCB
UBaseType_t uxDummy5;
void * pxDummy6;
uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];
/* Todo: Remove xCoreID for single core builds (IDF-7894) */
BaseType_t xDummyCoreID;
#if ( configNUMBER_OF_CORES > 1 )
BaseType_t xDummyCoreID;
#endif /* configNUMBER_OF_CORES > 1 */
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
void * pxDummy8;
#endif

View File

@@ -176,7 +176,9 @@ typedef struct xTASK_STATUS
StackType_t * pxEndOfStack; /**< Points to the end address of the task's stack area. */
#endif
configSTACK_DEPTH_TYPE usStackHighWaterMark; /**< The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
BaseType_t xCoreID; /**< Core this task is pinned to (0, 1, or tskNO_AFFINITY). If configNUMBER_OF_CORES == 1, this will always be 0. */
#if ( configTASKLIST_INCLUDE_COREID == 1 )
BaseType_t xCoreID; /**< Core this task is pinned to (0, 1, or tskNO_AFFINITY). If configNUMBER_OF_CORES == 1, this will always be 0. */
#endif
} TaskStatus_t;
/** Possible return values for eTaskConfirmSleepModeStatus(). */
@@ -211,7 +213,7 @@ typedef enum
*
* \ingroup Tasks
*/
#define taskVALID_CORE_ID( xCoreID ) ( ( ( ( ( BaseType_t ) xCoreID ) >= 0 && ( ( BaseType_t ) xCoreID ) < configNUMBER_OF_CORES ) || ( ( ( BaseType_t ) xCoreID ) == tskNO_AFFINITY ) ) ? pdTRUE : pdFALSE )
#define taskVALID_CORE_ID( xCoreID ) ( ( ( ( BaseType_t ) xCoreID ) >= 0 && ( ( BaseType_t ) xCoreID ) < configNUMBER_OF_CORES ) ? pdTRUE : pdFALSE )
/**
*