@@ -158,10 +158,10 @@ void vYieldCore( int xCoreID );
158158#define portCRITICAL_NESTING_IN_TCB 0
159159
160160extern UBaseType_t uxCriticalNestings [ configNUMBER_OF_CORES ];
161- #define portGET_CRITICAL_NESTING_COUNT () ( uxCriticalNestings[ portGET_CORE_ID( ) ] )
162- #define portSET_CRITICAL_NESTING_COUNT ( x ) ( uxCriticalNestings[ portGET_CORE_ID( ) ] = ( x ) )
163- #define portINCREMENT_CRITICAL_NESTING_COUNT () ( uxCriticalNestings[ portGET_CORE_ID( ) ]++ )
164- #define portDECREMENT_CRITICAL_NESTING_COUNT () ( uxCriticalNestings[ portGET_CORE_ID( ) ]-- )
161+ #define portGET_CRITICAL_NESTING_COUNT ( xCoreID ) ( uxCriticalNestings[ ( xCoreID ) ] )
162+ #define portSET_CRITICAL_NESTING_COUNT ( xCoreID , x ) ( uxCriticalNestings[ ( xCoreID ) ] = ( x ) )
163+ #define portINCREMENT_CRITICAL_NESTING_COUNT ( xCoreID ) ( uxCriticalNestings[ ( xCoreID ) ]++ )
164+ #define portDECREMENT_CRITICAL_NESTING_COUNT ( xCoreID ) ( uxCriticalNestings[ ( xCoreID ) ]-- )
165165
166166/*-----------------------------------------------------------*/
167167
@@ -210,21 +210,21 @@ __force_inline static bool spin_try_lock_unsafe(spin_lock_t *lock) {
210210
211211/* Note this is a single method with uxAcquire parameter since we have
212212 * static vars, the method is always called with a compile time constant for
213- * uxAcquire, and the compiler should dothe right thing! */
214- static inline void vPortRecursiveLock ( uint32_t ulLockNum ,
213+ * uxAcquire, and the compiler should do the right thing! */
214+ static inline void vPortRecursiveLock ( BaseType_t xCoreID ,
215+ uint32_t ulLockNum ,
215216 spin_lock_t * pxSpinLock ,
216217 BaseType_t uxAcquire )
217218{
218219 static volatile uint8_t ucOwnedByCore [ portMAX_CORE_COUNT ][portRTOS_SPINLOCK_COUNT ];
219220 static volatile uint8_t ucRecursionCountByLock [ portRTOS_SPINLOCK_COUNT ];
220221
221222 configASSERT ( ulLockNum < portRTOS_SPINLOCK_COUNT );
222- uint32_t ulCoreNum = get_core_num ();
223223
224224 if ( uxAcquire )
225225 {
226226 if (!spin_try_lock_unsafe (pxSpinLock )) {
227- if ( ucOwnedByCore [ ulCoreNum ][ ulLockNum ] )
227+ if ( ucOwnedByCore [ xCoreID ][ ulLockNum ] )
228228 {
229229 configASSERT ( ucRecursionCountByLock [ ulLockNum ] != 255u );
230230 ucRecursionCountByLock [ ulLockNum ]++ ;
@@ -234,31 +234,31 @@ static inline void vPortRecursiveLock( uint32_t ulLockNum,
234234 }
235235 configASSERT ( ucRecursionCountByLock [ ulLockNum ] == 0 );
236236 ucRecursionCountByLock [ ulLockNum ] = 1 ;
237- ucOwnedByCore [ ulCoreNum ][ ulLockNum ] = 1 ;
237+ ucOwnedByCore [ xCoreID ][ ulLockNum ] = 1 ;
238238 }
239239 else
240240 {
241- configASSERT ( ( ucOwnedByCore [ ulCoreNum ] [ulLockNum ] ) != 0 );
241+ configASSERT ( ( ucOwnedByCore [ xCoreID ] [ulLockNum ] ) != 0 );
242242 configASSERT ( ucRecursionCountByLock [ ulLockNum ] != 0 );
243243
244244 if ( !-- ucRecursionCountByLock [ ulLockNum ] )
245245 {
246- ucOwnedByCore [ ulCoreNum ] [ ulLockNum ] = 0 ;
246+ ucOwnedByCore [ xCoreID ] [ ulLockNum ] = 0 ;
247247 spin_unlock_unsafe (pxSpinLock );
248248 }
249249 }
250250}
251251
252252#if ( configNUMBER_OF_CORES == 1 )
253- #define portGET_ISR_LOCK ()
254- #define portRELEASE_ISR_LOCK ()
255- #define portGET_TASK_LOCK ()
256- #define portRELEASE_TASK_LOCK ()
253+ #define portGET_ISR_LOCK ( xCoreID )
254+ #define portRELEASE_ISR_LOCK ( xCoreID )
255+ #define portGET_TASK_LOCK ( xCoreID )
256+ #define portRELEASE_TASK_LOCK ( xCoreID )
257257#else
258- #define portGET_ISR_LOCK () vPortRecursiveLock( 0, spin_lock_instance( configSMP_SPINLOCK_0 ), pdTRUE )
259- #define portRELEASE_ISR_LOCK () vPortRecursiveLock( 0, spin_lock_instance( configSMP_SPINLOCK_0 ), pdFALSE )
260- #define portGET_TASK_LOCK () vPortRecursiveLock( 1, spin_lock_instance( configSMP_SPINLOCK_1 ), pdTRUE )
261- #define portRELEASE_TASK_LOCK () vPortRecursiveLock( 1, spin_lock_instance( configSMP_SPINLOCK_1 ), pdFALSE )
258+ #define portGET_ISR_LOCK ( xCoreID ) vPortRecursiveLock( ( xCoreID ), 0, spin_lock_instance( configSMP_SPINLOCK_0 ), pdTRUE )
259+ #define portRELEASE_ISR_LOCK ( xCoreID ) vPortRecursiveLock( ( xCoreID ), 0, spin_lock_instance( configSMP_SPINLOCK_0 ), pdFALSE )
260+ #define portGET_TASK_LOCK ( xCoreID ) vPortRecursiveLock( ( xCoreID ), 1, spin_lock_instance( configSMP_SPINLOCK_1 ), pdTRUE )
261+ #define portRELEASE_TASK_LOCK ( xCoreID ) vPortRecursiveLock( ( xCoreID ), 1, spin_lock_instance( configSMP_SPINLOCK_1 ), pdFALSE )
262262#endif
263263
264264/*-----------------------------------------------------------*/
0 commit comments