mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-06 08:47:18 +08:00
Update xTaskGetIdleTaskHandle() For SMP (#868)
* Update xTaskGetIdleTaskHandle() in SMP This commit updates xTaskGetIdleTaskHandle() for SMP in the following ways: - xTaskGetIdleTaskHandle() no longer accepts xCoreID argument in SMP so that there is not change in API between single-core and SMP - xTaskGetIdleTaskHandle() now returns the Active idle task handle in SMP, which matches the behavior in single-core. - Added xTaskGetIdleTaskHandleForCore() in SMP which accepts an xCoreID argument. This function can be used to obtain the Passive idle task handles. * Update xTaskGetIdleTaskHandle --------- Co-authored-by: Ching-Hsin Lee <chinglee@amazon.com> Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
@ -2030,24 +2030,23 @@ BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask,
|
||||
* xTaskGetIdleTaskHandle() is only available if
|
||||
* INCLUDE_xTaskGetIdleTaskHandle is set to 1 in FreeRTOSConfig.h.
|
||||
*
|
||||
* Simply returns the handle of the idle task. It is not valid to call
|
||||
* xTaskGetIdleTaskHandle() before the scheduler has been started.
|
||||
* In single-core FreeRTOS, this function simply returns the handle of the idle
|
||||
* task. It is not valid to call xTaskGetIdleTaskHandle() before the scheduler
|
||||
* has been started.
|
||||
*
|
||||
* In the FreeRTOS SMP, there are a total of configNUMBER_OF_CORES idle tasks:
|
||||
* 1. 1 Active idle task which does all the housekeeping.
|
||||
* 2. ( configNUMBER_OF_CORES - 1 ) Passive idle tasks which do nothing.
|
||||
* These idle tasks are created to ensure that each core has an idle task to run when
|
||||
* no other task is available to run.
|
||||
*
|
||||
* Set xCoreID to 0 to get the Active idle task handle. Set xCoreID to
|
||||
* 1,2 ... ( configNUMBER_OF_CORES - 1 ) to get the Passive idle task
|
||||
* handles.
|
||||
* no other task is available to run. Call xTaskGetIdleTaskHandle() or
|
||||
* xTaskGetIdleTaskHandleForCore() with xCoreID set to 0 to get the Active
|
||||
* idle task handle. Call xTaskGetIdleTaskHandleForCore() with xCoreID set to
|
||||
* 1,2 ... ( configNUMBER_OF_CORES - 1 ) to get the Passive idle task handles.
|
||||
*/
|
||||
#if ( configNUMBER_OF_CORES == 1 )
|
||||
TaskHandle_t xTaskGetIdleTaskHandle( void ) PRIVILEGED_FUNCTION;
|
||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||
TaskHandle_t xTaskGetIdleTaskHandle( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
|
||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||
TaskHandle_t xTaskGetIdleTaskHandleForCore( BaseType_t xCoreID ) PRIVILEGED_FUNCTION;
|
||||
|
||||
/**
|
||||
* configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for
|
||||
|
Reference in New Issue
Block a user