Skip to content

Commit

Permalink
Update critical nesting macros for SMP
Browse files Browse the repository at this point in the history
This is required for the change introduced in
FreeRTOS/FreeRTOS-Kernel#1206

Signed-off-by: Gaurav Aggarwal <[email protected]>
  • Loading branch information
aggarg committed Dec 23, 2024
1 parent 8b2955f commit 3fbc162
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GCC/RP2350_ARM_NTZ/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ static void prvTaskExitError( void )
* should instead call vTaskDelete( NULL ). Artificially force an assert()
* to be triggered if configASSERT() is defined, then stop here so
* application writers can catch the error. */
configASSERT( portGET_CRITICAL_NESTING_COUNT() == ~0UL );
configASSERT( portGET_CRITICAL_NESTING_COUNT( 0 ) == ~0UL );
portDISABLE_INTERRUPTS();

while( ulDummy == 0 )
Expand Down
10 changes: 5 additions & 5 deletions GCC/RP2350_ARM_NTZ/non_secure/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ void vYieldCore( int xCoreID );

/* Critical nesting count management. */
#if configNUMBER_OF_CORES == 1
#define portGET_CRITICAL_NESTING_COUNT() ulCriticalNesting
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ulCriticalNesting
#else
extern volatile uint32_t ulCriticalNestings[ configNUMBER_OF_CORES ];
#define portGET_CRITICAL_NESTING_COUNT() ( ulCriticalNestings[ portGET_CORE_ID() ] )
#define portSET_CRITICAL_NESTING_COUNT( x ) ( ulCriticalNestings[ portGET_CORE_ID() ] = ( x ) )
#define portINCREMENT_CRITICAL_NESTING_COUNT() ( ulCriticalNestings[ portGET_CORE_ID() ]++ )
#define portDECREMENT_CRITICAL_NESTING_COUNT() ( ulCriticalNestings[ portGET_CORE_ID() ]-- )
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ( ulCriticalNestings[ ( xCoreID ) ] )
#define portSET_CRITICAL_NESTING_COUNT( xCoreID, x ) ( ulCriticalNestings[ ( xCoreID ) ] = ( x ) )
#define portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( ulCriticalNestings[ ( xCoreID ) ]++ )
#define portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( ulCriticalNestings[ ( xCoreID ) ]-- )
#endif
/*-----------------------------------------------------------*/

Expand Down
10 changes: 5 additions & 5 deletions GCC/RP2350_RISC-V/include/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ extern void vPortYield(void);

#if ( configNUMBER_OF_CORES == 1 )
extern size_t xCriticalNesting;
#define portGET_CRITICAL_NESTING_COUNT() xCriticalNesting
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) xCriticalNesting
#define portENTER_CRITICAL() \
{ \
portDISABLE_INTERRUPTS(); \
Expand Down Expand Up @@ -190,10 +190,10 @@ extern void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus );
#define portENTER_CRITICAL_FROM_ISR() vTaskEnterCriticalFromISR()
#define portEXIT_CRITICAL_FROM_ISR( x ) vTaskExitCriticalFromISR( x )

#define portGET_CRITICAL_NESTING_COUNT() ( xCriticalNestings[ portGET_CORE_ID() ] )
#define portSET_CRITICAL_NESTING_COUNT( x ) ( xCriticalNestings[ portGET_CORE_ID() ] = ( x ) )
#define portINCREMENT_CRITICAL_NESTING_COUNT() ( xCriticalNestings[ portGET_CORE_ID() ]++ )
#define portDECREMENT_CRITICAL_NESTING_COUNT() ( xCriticalNestings[ portGET_CORE_ID() ]-- )
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ( xCriticalNestings[ ( xCoreID ) ] )
#define portSET_CRITICAL_NESTING_COUNT( xCoreID, x ) ( xCriticalNestings[ ( xCoreID ) ] = ( x ) )
#define portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( xCriticalNestings[ ( xCoreID ) ]++ )
#define portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( xCriticalNestings[ ( xCoreID ) ]-- )

#endif /* if ( configNUMBER_OF_CORES == 1 ) */

Expand Down

0 comments on commit 3fbc162

Please sign in to comment.