mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 00:37:44 -04:00
fix(freertos-smp): Miscellaneous fixes for granular locks
This commit is contained in:
parent
e3d92dd5fd
commit
35025858cf
7 changed files with 302 additions and 359 deletions
34
queue.c
34
queue.c
|
@ -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 ) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue