change(freertos/smp): Update queue.c locking

Updated queue.c to use granular locking

- Added xTaskSpinlock and xISRSpinlock
- Replaced  critical section macros with data group critical section macros
such as taskENTER/EXIT_CRITICAL/_FROM_ISR() with queueENTER/EXIT_CRITICAL_FROM_ISR().
- Added vQueueEnterCritical/FromISR() and vQueueExitCritical/FromISR()
  which map to the data group critical section macros.
- Added prvLockQueueForTasks() and prvUnlockQueueForTasks() as the granular locking equivalents
to prvLockQueue() and prvUnlockQueue() respectively

Co-authored-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
This commit is contained in:
Darian Leung 2024-06-16 00:53:03 +08:00 committed by Sudeep Mohanty
parent 1ae917325c
commit 813017082e
2 changed files with 288 additions and 244 deletions

View file

@ -2150,10 +2150,18 @@
#define traceENTER_xTaskRemoveFromEventList( pxEventList )
#endif
#ifndef traceENTER_xTaskRemoveFromEventListFromISR
#define traceENTER_xTaskRemoveFromEventListFromISR( pxEventList )
#endif
#ifndef traceRETURN_xTaskRemoveFromEventList
#define traceRETURN_xTaskRemoveFromEventList( xReturn )
#endif
#ifndef traceRETURN_xTaskRemoveFromEventListFromISR
#define traceRETURN_xTaskRemoveFromEventListFromISR( xReturn )
#endif
#ifndef traceENTER_vTaskRemoveFromUnorderedEventList
#define traceENTER_vTaskRemoveFromUnorderedEventList( pxEventListItem, xItemValue )
#endif
@ -3324,6 +3332,10 @@ typedef struct xSTATIC_QUEUE
UBaseType_t uxDummy8;
uint8_t ucDummy9;
#endif
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
portSPINLOCK_TYPE xDummySpinlock[ 2 ];
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
} StaticQueue_t;
typedef StaticQueue_t StaticSemaphore_t;
@ -3353,6 +3365,10 @@ typedef struct xSTATIC_EVENT_GROUP
#if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
uint8_t ucDummy4;
#endif
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
portSPINLOCK_TYPE xDummySpinlock[ 2 ];
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
} StaticEventGroup_t;
/*
@ -3408,6 +3424,9 @@ typedef struct xSTATIC_STREAM_BUFFER
void * pvDummy5[ 2 ];
#endif
UBaseType_t uxDummy6;
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
portSPINLOCK_TYPE xDummySpinlock[ 2 ];
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
} StaticStreamBuffer_t;
/* Message buffers are built on stream buffers. */

513
queue.c

File diff suppressed because it is too large Load diff