Skip to content

Commit

Permalink
Merge branch 'smp_granular_locks_v4' into smp_granular_locks_v4_rp204…
Browse files Browse the repository at this point in the history
…0_v2
  • Loading branch information
chinglee-iot committed Sep 2, 2024
2 parents 6991eb0 + ea82219 commit 1521667
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 124 deletions.
14 changes: 7 additions & 7 deletions queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ typedef xQUEUE Queue_t;
* to indicate that a task may require unblocking. When the queue in unlocked
* these lock counts are inspected, and the appropriate action taken.
*/
#if ( ( portUSING_GRANULAR_LOCKS == 0 ) && ( configNUMBER_OF_CORES > 1 ) )
#if ( portUSING_GRANULAR_LOCKS == 0 )
static void prvUnlockQueue( Queue_t * const pxQueue ) PRIVILEGED_FUNCTION;
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 0 ) && ( configNUMBER_OF_CORES > 1 ) ) */
#endif /* #if ( portUSING_GRANULAR_LOCKS == 0 ) */

/*
* Suspends a queue. Prevents other tasks from accessing the queue but allows
Expand Down Expand Up @@ -268,7 +268,7 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
* Macro to mark a queue as locked. Locking a queue prevents an ISR from
* accessing the queue event lists.
*/
#if ( ( portUSING_GRANULAR_LOCKS == 0 ) && ( configNUMBER_OF_CORES > 1 ) )
#if ( portUSING_GRANULAR_LOCKS == 0 )
#define prvLockQueue( pxQueue ) \
taskLOCK_DATA_GROUP( &( pxQueue->xTaskSpinlock ), &( pxQueue->xISRSpinlock ) ); \
{ \
Expand All @@ -282,7 +282,7 @@ static void prvInitialiseNewQueue( const UBaseType_t uxQueueLength,
} \
} \
taskUNLOCK_DATA_GROUP( &( pxQueue->xTaskSpinlock ), &( pxQueue->xISRSpinlock ) )
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 0 ) && ( configNUMBER_OF_CORES > 1 ) ) */
#endif /* #if ( portUSING_GRANULAR_LOCKS == 0 ) */

/*
* Macro to increment cTxLock member of the queue data structure. It is
Expand Down Expand Up @@ -2184,7 +2184,7 @@ UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue )

traceENTER_uxQueueMessagesWaiting( xQueue );

configASSERT( xQueue );
configASSERT( pxQueue );

taskLOCK_DATA_GROUP( &( pxQueue->xTaskSpinlock ), &( pxQueue->xISRSpinlock ) );
{
Expand Down Expand Up @@ -2448,7 +2448,7 @@ static void prvCopyDataFromQueue( Queue_t * const pxQueue,
}
/*-----------------------------------------------------------*/

#if ( ( portUSING_GRANULAR_LOCKS == 0 ) && ( configNUMBER_OF_CORES > 1 ) )
#if ( portUSING_GRANULAR_LOCKS == 0 )
static void prvUnlockQueue( Queue_t * const pxQueue )
{
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. */
Expand Down Expand Up @@ -2567,7 +2567,7 @@ static void prvCopyDataFromQueue( Queue_t * const pxQueue,
}
taskUNLOCK_DATA_GROUP( &( pxQueue->xTaskSpinlock ), &( pxQueue->xISRSpinlock ) );
}
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 0 ) && ( configNUMBER_OF_CORES > 1 ) ) */
#endif /* #if ( portUSING_GRANULAR_LOCKS == 0 ) */
/*-----------------------------------------------------------*/

#if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
Expand Down
2 changes: 1 addition & 1 deletion stream_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#define sbRESUME( pxStreamBuffer ) prvResumeStreamBuffer( pxStreamBuffer )
#else /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
#define sbSUSPEND( pxStreamBuffer ) vTaskSuspendAll()
#define sbRESUME( pxStreamBuffer ) xTaskResumeAll()
#define sbRESUME( pxStreamBuffer ) ( void ) xTaskResumeAll()
#endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */

/* If the user has not provided application specific Rx notification macros,
Expand Down
Loading

0 comments on commit 1521667

Please sign in to comment.