mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
adding a minimal idle hook to the SMP port (#329)
* adjusting the kernel checks repo * Added a minimal idle hook for all idle tasks
This commit is contained in:
parent
0c1381311b
commit
b515641e0a
2
.github/workflows/kernel-checks.yml
vendored
2
.github/workflows/kernel-checks.yml
vendored
|
@ -21,7 +21,7 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
repository: FreeRTOS/FreeRTOS
|
repository: FreeRTOS/FreeRTOS
|
||||||
ref: master
|
ref: smp
|
||||||
path: tools
|
path: tools
|
||||||
|
|
||||||
# Checkout user pull request changes
|
# Checkout user pull request changes
|
||||||
|
|
41
tasks.c
41
tasks.c
|
@ -1000,8 +1000,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The ready task that was removed from this core is excluded from it.
|
/* The ready task that was removed from this core is excluded from it. */
|
||||||
* @todo See if we can schedule it on any of the cores where it is not excluded from. */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uxCoreMap &= ( ( 1 << configNUM_CORES ) - 1 );
|
uxCoreMap &= ( ( 1 << configNUM_CORES ) - 1 );
|
||||||
|
@ -2242,7 +2241,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
|
||||||
{
|
{
|
||||||
xCoreID = ( BaseType_t ) pxTCB->xTaskRunState;
|
xCoreID = ( BaseType_t ) pxTCB->xTaskRunState;
|
||||||
|
|
||||||
if( ( uxCoreAffinityMask & ( 1 << xCoreID ) ) != 0 )
|
if( ( uxCoreAffinityMask & ( 1 << xCoreID ) ) == 0 )
|
||||||
{
|
{
|
||||||
prvYieldCore( xCoreID );
|
prvYieldCore( xCoreID );
|
||||||
}
|
}
|
||||||
|
@ -2695,6 +2694,7 @@ static BaseType_t prvCreateIdleTasks( void )
|
||||||
pxIdleTaskStackBuffer,
|
pxIdleTaskStackBuffer,
|
||||||
pxIdleTaskTCBBuffer ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
|
pxIdleTaskTCBBuffer ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ( configNUM_CORES > 1 )
|
#if ( configNUM_CORES > 1 )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2747,6 +2747,7 @@ static BaseType_t prvCreateIdleTasks( void )
|
||||||
}
|
}
|
||||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4222,6 +4223,7 @@ void vTaskMissedYield( void )
|
||||||
static portTASK_FUNCTION( prvMinimalIdleTask, pvParameters )
|
static portTASK_FUNCTION( prvMinimalIdleTask, pvParameters )
|
||||||
{
|
{
|
||||||
taskYIELD();
|
taskYIELD();
|
||||||
|
|
||||||
for( ; ; )
|
for( ; ; )
|
||||||
{
|
{
|
||||||
#if ( configUSE_PREEMPTION == 0 )
|
#if ( configUSE_PREEMPTION == 0 )
|
||||||
|
@ -4256,6 +4258,22 @@ static portTASK_FUNCTION( prvMinimalIdleTask, pvParameters )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) ) */
|
#endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) ) */
|
||||||
|
|
||||||
|
#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
|
||||||
|
{
|
||||||
|
extern void vApplicationMinimalIdleHook( void );
|
||||||
|
|
||||||
|
/* Call the user defined function from within the idle task. This
|
||||||
|
* allows the application designer to add background functionality
|
||||||
|
* without the overhead of a separate task.
|
||||||
|
*
|
||||||
|
* This hook is intended to manage core activity such as disabling cores that go idle.
|
||||||
|
*
|
||||||
|
* NOTE: vApplicationMinimalIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
|
||||||
|
* CALL A FUNCTION THAT MIGHT BLOCK. */
|
||||||
|
vApplicationMinimalIdleHook();
|
||||||
|
}
|
||||||
|
#endif /* configUSE_MINIMAL_IDLE_HOOK */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* if ( configNUM_CORES > 1 ) */
|
#endif /* if ( configNUM_CORES > 1 ) */
|
||||||
|
@ -4330,6 +4348,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
||||||
/* Call the user defined function from within the idle task. This
|
/* Call the user defined function from within the idle task. This
|
||||||
* allows the application designer to add background functionality
|
* allows the application designer to add background functionality
|
||||||
* without the overhead of a separate task.
|
* without the overhead of a separate task.
|
||||||
|
*
|
||||||
* NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
|
* NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
|
||||||
* CALL A FUNCTION THAT MIGHT BLOCK. */
|
* CALL A FUNCTION THAT MIGHT BLOCK. */
|
||||||
vApplicationIdleHook();
|
vApplicationIdleHook();
|
||||||
|
@ -4385,6 +4404,22 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
|
|
||||||
|
#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
|
||||||
|
{
|
||||||
|
extern void vApplicationMinimalIdleHook( void );
|
||||||
|
|
||||||
|
/* Call the user defined function from within the idle task. This
|
||||||
|
* allows the application designer to add background functionality
|
||||||
|
* without the overhead of a separate task.
|
||||||
|
*
|
||||||
|
* This hook is intended to manage core activity such as disabling cores that go idle.
|
||||||
|
*
|
||||||
|
* NOTE: vApplicationMinimalIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
|
||||||
|
* CALL A FUNCTION THAT MIGHT BLOCK. */
|
||||||
|
vApplicationMinimalIdleHook();
|
||||||
|
}
|
||||||
|
#endif /* configUSE_MINIMAL_IDLE_HOOK */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue