mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
refactor(freertos/idf): Move IDF task utility functions to API addition headers
This commit combines various task utility API additions in IDF FreeRTOS and with their Amazon SMP FreeRTOS addition counterparts. The folloiwng functions have been moved to freertos_tasks_c_additions.h and idf_additions.h as these API are considered public: - xTaskGetCurrentTaskHandleForCPU() - xTaskGetIdleTaskHandleForCPU() - xTaskGetAffinity() - pxTaskGetStackStart() Also fixed in missing #if macros when vTaskCoreAffinityGet() is called in Amazon SMP FreerTOS tests.
This commit is contained in:
@@ -3016,12 +3016,6 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
|
||||
return xIdleTaskHandle[ xPortGetCoreID() ];
|
||||
}
|
||||
|
||||
TaskHandle_t xTaskGetIdleTaskHandleForCPU( UBaseType_t cpuid )
|
||||
{
|
||||
configASSERT( cpuid < configNUM_CORES );
|
||||
configASSERT( ( xIdleTaskHandle[ cpuid ] != NULL ) );
|
||||
return xIdleTaskHandle[ cpuid ];
|
||||
}
|
||||
#endif /* INCLUDE_xTaskGetIdleTaskHandle */
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
@@ -4677,16 +4671,6 @@ static void prvCheckTasksWaitingTermination( void )
|
||||
#endif /* configUSE_TRACE_FACILITY */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
||||
{
|
||||
TCB_t * pxTCB;
|
||||
|
||||
pxTCB = prvGetTCBFromHandle( xTask );
|
||||
|
||||
return pxTCB->xCoreID;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
static UBaseType_t prvListTasksWithinSingleList( TaskStatus_t * pxTaskStatusArray,
|
||||
@@ -4809,20 +4793,6 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
||||
|
||||
#endif /* INCLUDE_uxTaskGetStackHighWaterMark */
|
||||
/*-----------------------------------------------------------*/
|
||||
#if ( INCLUDE_pxTaskGetStackStart == 1 )
|
||||
|
||||
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
||||
{
|
||||
TCB_t * pxTCB;
|
||||
uint8_t * uxReturn;
|
||||
|
||||
pxTCB = prvGetTCBFromHandle( xTask );
|
||||
uxReturn = ( uint8_t * ) pxTCB->pxStack;
|
||||
|
||||
return uxReturn;
|
||||
}
|
||||
|
||||
#endif /* INCLUDE_pxTaskGetStackStart */
|
||||
|
||||
#if ( INCLUDE_vTaskDelete == 1 )
|
||||
|
||||
@@ -4910,7 +4880,7 @@ static void prvResetNextTaskUnblockTime( void )
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) || ( configNUM_CORES > 1 ) )
|
||||
#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
|
||||
|
||||
TaskHandle_t xTaskGetCurrentTaskHandle( void )
|
||||
{
|
||||
@@ -4924,19 +4894,6 @@ static void prvResetNextTaskUnblockTime( void )
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t cpuid )
|
||||
{
|
||||
TaskHandle_t xReturn = NULL;
|
||||
|
||||
/*Xtensa-specific: the pxCurrentPCB pointer is atomic so we shouldn't need a lock. */
|
||||
if( cpuid < configNUM_CORES )
|
||||
{
|
||||
xReturn = pxCurrentTCB[ cpuid ];
|
||||
}
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
|
||||
#endif /* ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
Reference in New Issue
Block a user