Skip to content

Commit 68ace34

Browse files
change(freertos/smp): Update stream_buffer.c locking
Updated stream_buffer.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 sbENTER/EXIT_CRITICAL_FROM_ISR(). - Added vStreambuffersEnterCritical/FromISR() and vStreambuffersExitCritical/FromISR() to map to the data group critical section macros. - Added prvLockStreamBufferForTasks() and prvUnlockStreamBufferForTasks() to suspend the stream buffer when executing non-deterministic code. Co-authored-by: Sudeep Mohanty <[email protected]>
1 parent 4548bd5 commit 68ace34

File tree

2 files changed

+245
-19
lines changed

2 files changed

+245
-19
lines changed

include/FreeRTOS.h

+3
Original file line numberDiff line numberDiff line change
@@ -3410,6 +3410,9 @@ typedef struct xSTATIC_STREAM_BUFFER
34103410
void * pvDummy5[ 2 ];
34113411
#endif
34123412
UBaseType_t uxDummy6;
3413+
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
3414+
portSPINLOCK_TYPE xDummySpinlock[ 2 ];
3415+
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
34133416
} StaticStreamBuffer_t;
34143417

34153418
/* Message buffers are built on stream buffers. */

0 commit comments

Comments
 (0)