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 63fee6c23a
commit ee0ee4887f
10 changed files with 99 additions and 41 deletions

View File

@@ -301,7 +301,11 @@ static void vPortCleanUpCoprocArea(void *pvTCB)
* If yes, reset the owner. */
if (sa->sa_enable != 0) {
/* Get the core the task is pinned on */
const BaseType_t coreID = task->xDummyCoreID;
#if ( configNUM_CORES > 1 )
const BaseType_t coreID = task->xDummyCoreID;
#else /* configNUM_CORES > 1 */
const BaseType_t coreID = 0;
#endif /* configNUM_CORES > 1 */
for (int i = 0; i < SOC_CPU_COPROC_NUM; i++) {
StaticTask_t** owner = &port_uxCoprocOwner[coreID][i];
@@ -767,11 +771,12 @@ void vPortTCBPreDeleteHook( void *pxTCB )
* are saved lazily, as soon as a task starts using one, it must always be scheduled on the core
* it is currently executing on.
*/
#if ( configNUM_CORES > 1 )
void vPortTaskPinToCore(StaticTask_t* task, int coreid)
{
task->xDummyCoreID = coreid;
}
#endif /* configNUM_CORES > 1 */
/**
* @brief Get coprocessor save area out of the given task. If the coprocessor area is not created,