Skip to content

Commit 32d8176

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 b3e2444 commit 32d8176

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
@@ -3442,6 +3442,9 @@ typedef struct xSTATIC_STREAM_BUFFER
34423442
void * pvDummy5[ 2 ];
34433443
#endif
34443444
UBaseType_t uxDummy6;
3445+
#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
3446+
portSPINLOCK_TYPE xDummySpinlock[ 2 ];
3447+
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
34453448
} StaticStreamBuffer_t;
34463449

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

0 commit comments

Comments
 (0)