mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-13 16:27:43 -04:00
fix(freertos-smp): Always take ISR locks in vTaskEnter/ExitCriticalFromISR
This commit is contained in:
parent
5098b1ae26
commit
1b91c544f9
1 changed files with 26 additions and 7 deletions
33
tasks.c
33
tasks.c
|
@ -7582,10 +7582,18 @@ static void prvResetNextTaskUnblockTime( void )
|
||||||
{
|
{
|
||||||
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
|
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();
|
||||||
|
|
||||||
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U )
|
#if ( portUSING_GRANULAR_LOCKS == 1 )
|
||||||
{
|
{
|
||||||
kernelGET_ISR_LOCK( xCoreID );
|
kernelGET_ISR_LOCK( xCoreID );
|
||||||
}
|
}
|
||||||
|
#else /* portUSING_GRANULAR_LOCKS */
|
||||||
|
{
|
||||||
|
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U )
|
||||||
|
{
|
||||||
|
kernelGET_ISR_LOCK( xCoreID );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* portUSING_GRANULAR_LOCKS */
|
||||||
|
|
||||||
portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID );
|
portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID );
|
||||||
}
|
}
|
||||||
|
@ -7775,17 +7783,28 @@ static void prvResetNextTaskUnblockTime( void )
|
||||||
|
|
||||||
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U )
|
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U )
|
||||||
{
|
{
|
||||||
portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID );
|
#if ( portUSING_GRANULAR_LOCKS == 1 )
|
||||||
|
|
||||||
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U )
|
|
||||||
{
|
{
|
||||||
kernelRELEASE_ISR_LOCK( xCoreID );
|
kernelRELEASE_ISR_LOCK( xCoreID );
|
||||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
|
|
||||||
|
portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID );
|
||||||
|
|
||||||
|
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U )
|
||||||
|
{
|
||||||
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
#else /* portUSING_GRANULAR_LOCKS */
|
||||||
{
|
{
|
||||||
mtCOVERAGE_TEST_MARKER();
|
portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID );
|
||||||
|
|
||||||
|
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0U )
|
||||||
|
{
|
||||||
|
kernelRELEASE_ISR_LOCK( xCoreID );
|
||||||
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* portUSING_GRANULAR_LOCKS */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue