Skip to content

Commit 3fbc162

Browse files
committed
Update critical nesting macros for SMP
This is required for the change introduced in FreeRTOS/FreeRTOS-Kernel#1206 Signed-off-by: Gaurav Aggarwal <[email protected]>
1 parent 8b2955f commit 3fbc162

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

GCC/RP2350_ARM_NTZ/non_secure/port.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ static void prvTaskExitError( void )
867867
* should instead call vTaskDelete( NULL ). Artificially force an assert()
868868
* to be triggered if configASSERT() is defined, then stop here so
869869
* application writers can catch the error. */
870-
configASSERT( portGET_CRITICAL_NESTING_COUNT() == ~0UL );
870+
configASSERT( portGET_CRITICAL_NESTING_COUNT( 0 ) == ~0UL );
871871
portDISABLE_INTERRUPTS();
872872

873873
while( ulDummy == 0 )

GCC/RP2350_ARM_NTZ/non_secure/portmacro.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ void vYieldCore( int xCoreID );
153153

154154
/* Critical nesting count management. */
155155
#if configNUMBER_OF_CORES == 1
156-
#define portGET_CRITICAL_NESTING_COUNT() ulCriticalNesting
156+
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ulCriticalNesting
157157
#else
158158
extern volatile uint32_t ulCriticalNestings[ configNUMBER_OF_CORES ];
159-
#define portGET_CRITICAL_NESTING_COUNT() ( ulCriticalNestings[ portGET_CORE_ID() ] )
160-
#define portSET_CRITICAL_NESTING_COUNT( x ) ( ulCriticalNestings[ portGET_CORE_ID() ] = ( x ) )
161-
#define portINCREMENT_CRITICAL_NESTING_COUNT() ( ulCriticalNestings[ portGET_CORE_ID() ]++ )
162-
#define portDECREMENT_CRITICAL_NESTING_COUNT() ( ulCriticalNestings[ portGET_CORE_ID() ]-- )
159+
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ( ulCriticalNestings[ ( xCoreID ) ] )
160+
#define portSET_CRITICAL_NESTING_COUNT( xCoreID, x ) ( ulCriticalNestings[ ( xCoreID ) ] = ( x ) )
161+
#define portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( ulCriticalNestings[ ( xCoreID ) ]++ )
162+
#define portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( ulCriticalNestings[ ( xCoreID ) ]-- )
163163
#endif
164164
/*-----------------------------------------------------------*/
165165

GCC/RP2350_RISC-V/include/portmacro.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ extern void vPortYield(void);
161161

162162
#if ( configNUMBER_OF_CORES == 1 )
163163
extern size_t xCriticalNesting;
164-
#define portGET_CRITICAL_NESTING_COUNT() xCriticalNesting
164+
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) xCriticalNesting
165165
#define portENTER_CRITICAL() \
166166
{ \
167167
portDISABLE_INTERRUPTS(); \
@@ -190,10 +190,10 @@ extern void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus );
190190
#define portENTER_CRITICAL_FROM_ISR() vTaskEnterCriticalFromISR()
191191
#define portEXIT_CRITICAL_FROM_ISR( x ) vTaskExitCriticalFromISR( x )
192192

193-
#define portGET_CRITICAL_NESTING_COUNT() ( xCriticalNestings[ portGET_CORE_ID() ] )
194-
#define portSET_CRITICAL_NESTING_COUNT( x ) ( xCriticalNestings[ portGET_CORE_ID() ] = ( x ) )
195-
#define portINCREMENT_CRITICAL_NESTING_COUNT() ( xCriticalNestings[ portGET_CORE_ID() ]++ )
196-
#define portDECREMENT_CRITICAL_NESTING_COUNT() ( xCriticalNestings[ portGET_CORE_ID() ]-- )
193+
#define portGET_CRITICAL_NESTING_COUNT( xCoreID ) ( xCriticalNestings[ ( xCoreID ) ] )
194+
#define portSET_CRITICAL_NESTING_COUNT( xCoreID, x ) ( xCriticalNestings[ ( xCoreID ) ] = ( x ) )
195+
#define portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( xCriticalNestings[ ( xCoreID ) ]++ )
196+
#define portDECREMENT_CRITICAL_NESTING_COUNT( xCoreID ) ( xCriticalNestings[ ( xCoreID ) ]-- )
197197

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

0 commit comments

Comments
 (0)