Skip to content

Commit 730310e

Browse files
committed
Code review suggestions
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
1 parent f59c1da commit 730310e

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

portable/CCRH/F1Kx/portmacro.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@
149149
extern void vPortRecursiveLockAcquire( BaseType_t xCoreID, BaseType_t xFromIsr );
150150
extern void vPortRecursiveLockRelease( BaseType_t xCoreID, BaseType_t xFromIsr );
151151

152-
#define portGET_ISR_LOCK( xCoreID ) vPortRecursiveLockAcquire( xCoreID, pdTRUE )
153-
#define portRELEASE_ISR_LOCK( xCoreID ) vPortRecursiveLockRelease( xCoreID, pdTRUE )
154-
#define portGET_TASK_LOCK( xCoreID ) vPortRecursiveLockAcquire( xCoreID, pdFALSE )
155-
#define portRELEASE_TASK_LOCK( xCoreID ) vPortRecursiveLockRelease( xCoreID, pdFALSE )
152+
#define portGET_ISR_LOCK( xCoreID ) vPortRecursiveLockAcquire( ( xCoreID ), pdTRUE )
153+
#define portRELEASE_ISR_LOCK( xCoreID ) vPortRecursiveLockRelease( ( xCoreID ), pdTRUE )
154+
#define portGET_TASK_LOCK( xCoreID ) vPortRecursiveLockAcquire( ( xCoreID ), pdFALSE )
155+
#define portRELEASE_TASK_LOCK( xCoreID ) vPortRecursiveLockRelease( ( xCoreID ), pdFALSE )
156156
#endif /* if ( configNUMBER_OF_CORES == 1 ) */
157157

158158
/*-----------------------------------------------------------*/

portable/ThirdParty/GCC/RP2040/include/portmacro.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ static inline void vPortRecursiveLock( BaseType_t xCoreID,
255255
#define portGET_TASK_LOCK( xCoreID )
256256
#define portRELEASE_TASK_LOCK( xCoreID )
257257
#else
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 )
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
/*-----------------------------------------------------------*/

portable/ThirdParty/xClang/XCOREAI/portmacro.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@
152152

153153
#define portASSERT_IF_IN_ISR() configASSERT( portCHECK_IF_IN_ISR() == 0 )
154154

155-
#define portGET_ISR_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_acquire( 0 ) ); } while( 0 )
156-
#define portRELEASE_ISR_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_release( 0 ) ); } while( 0 )
157-
#define portGET_TASK_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_acquire( 1 ) ); } while( 0 )
158-
#define portRELEASE_TASK_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_release( 1 ) ); } while( 0 )
155+
#define portGET_ISR_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_acquire( 0 ); } while( 0 )
156+
#define portRELEASE_ISR_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_release( 0 ); } while( 0 )
157+
#define portGET_TASK_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_acquire( 1 ); } while( 0 )
158+
#define portRELEASE_TASK_LOCK( xCoreID ) do{ ( void )( xCoreID ); rtos_lock_release( 1 ); } while( 0 )
159159

160160

161161
void vTaskEnterCritical( void );

tasks.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3892,6 +3892,11 @@ void vTaskSuspendAll( void )
38923892
mtCOVERAGE_TEST_MARKER();
38933893
}
38943894

3895+
/* Query the coreID again as prvCheckForRunStateChange may have
3896+
* caused the task to get scheduled on a different core. The correct
3897+
* task lock for the core is acquired in prvCheckForRunStateChange. */
3898+
xCoreID = ( BaseType_t ) portGET_CORE_ID();
3899+
38953900
portGET_ISR_LOCK( xCoreID );
38963901

38973902
/* The scheduler is suspended if uxSchedulerSuspended is non-zero. An increment

0 commit comments

Comments
 (0)