fix(freertos-smp): Miscellaneous fixes for granular locks

This commit is contained in:
Sudeep Mohanty 2025-08-15 17:03:39 +02:00
parent e3d92dd5fd
commit 35025858cf
7 changed files with 302 additions and 359 deletions

34
queue.c
View file

@ -328,25 +328,23 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
* When the tasks unlocks the queue, all pended access attempts are handled.
*/
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
#define queueLOCK( pxQueue ) \
do { \
vTaskPreemptionDisable( NULL ); \
prvLockQueue( ( pxQueue ) ); \
portGET_SPINLOCK( portGET_CORE_ID(), &( pxQueue->xTaskSpinlock ) ); \
#define queueLOCK( pxQueue ) \
do { \
taskDATA_GROUP_LOCK( &( ( pxQueue )->xTaskSpinlock ) ); \
prvLockQueue( ( pxQueue ) ); \
} while( 0 )
#define queueUNLOCK( pxQueue, xYieldAPI ) \
do { \
prvUnlockQueue( ( pxQueue ) ); \
portRELEASE_SPINLOCK( portGET_CORE_ID(), &( pxQueue->xTaskSpinlock ) ); \
vTaskPreemptionEnable( NULL ); \
if( ( xYieldAPI ) == pdTRUE ) \
{ \
taskYIELD_WITHIN_API(); \
} \
else \
{ \
mtCOVERAGE_TEST_MARKER(); \
} \
#define queueUNLOCK( pxQueue, xYieldAPI ) \
do { \
prvUnlockQueue( ( pxQueue ) ); \
taskDATA_GROUP_UNLOCK( &( ( pxQueue )->xTaskSpinlock ) ); \
if( ( xYieldAPI ) == pdTRUE ) \
{ \
taskYIELD_WITHIN_API(); \
} \
else \
{ \
mtCOVERAGE_TEST_MARKER(); \
} \
} while( 0 )
#else /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
#define queueLOCK( pxQueue ) \