Lines Matching +full:- +full:- +full:post +full:- +full:data
5 * SPDX-License-Identifier: MIT
52 #define queueUNLOCKED ( ( int8_t ) -1 )
80 /* Semaphores do not actually store or copy data, so have an item size of
101 * rationale: https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
110 …QueuePointers_t xQueue; /**< Data required exclusively when this structure is used as a queue.…
111 …SemaphoreData_t xSemaphore; /**< Data required exclusively when this structure is used as a semaph…
114 …List_t xTasksWaitingToSend; /**< List of tasks that are blocked waiting to post onto t…
142 /*-----------------------------------------------------------*/
169 /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-84 */
186 * Uses a critical section to determine if there is any data in a queue.
217 * the queue set that the queue contains data.
246 * disinherit the priority - but only down to the highest priority of any
252 /*-----------------------------------------------------------*/
261 if( ( pxQueue )->cRxLock == queueUNLOCKED ) \
263 ( pxQueue )->cRxLock = queueLOCKED_UNMODIFIED; \
265 if( ( pxQueue )->cTxLock == queueUNLOCKED ) \
267 ( pxQueue )->cTxLock = queueLOCKED_UNMODIFIED; \
273 * Macro to increment cTxLock member of the queue data structure. It is
283 ( pxQueue )->cTxLock = ( int8_t ) ( ( cTxLock ) + ( int8_t ) 1 ); \
288 * Macro to increment cRxLock member of the queue data structure. It is
298 ( pxQueue )->cRxLock = ( int8_t ) ( ( cRxLock ) + ( int8_t ) 1 ); \
301 /*-----------------------------------------------------------*/
314 ( pxQueue->uxLength >= 1U ) && in xQueueGenericReset()
316 ( ( SIZE_MAX / pxQueue->uxLength ) >= pxQueue->uxItemSize ) ) in xQueueGenericReset()
320 … pxQueue->u.xQueue.pcTail = pxQueue->pcHead + ( pxQueue->uxLength * pxQueue->uxItemSize ); in xQueueGenericReset()
321 pxQueue->uxMessagesWaiting = ( UBaseType_t ) 0U; in xQueueGenericReset()
322 pxQueue->pcWriteTo = pxQueue->pcHead; in xQueueGenericReset()
323 …pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead + ( ( pxQueue->uxLength - 1U ) * pxQueue->uxItemSiz… in xQueueGenericReset()
324 pxQueue->cRxLock = queueUNLOCKED; in xQueueGenericReset()
325 pxQueue->cTxLock = queueUNLOCKED; in xQueueGenericReset()
334 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueGenericReset()
336 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueGenericReset()
353 vListInitialise( &( pxQueue->xTasksWaitingToSend ) ); in xQueueGenericReset()
354 vListInitialise( &( pxQueue->xTasksWaitingToReceive ) ); in xQueueGenericReset()
372 /*-----------------------------------------------------------*/
415 … /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */ in xQueueGenericCreateStatic()
424 pxNewQueue->ucStaticallyAllocated = pdTRUE; in xQueueGenericCreateStatic()
442 /*-----------------------------------------------------------*/
461 if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdTRUE ) in xQueueGenericGetStaticBuffers()
465 *ppucQueueStorage = ( uint8_t * ) pxQueue->pcHead; in xQueueGenericGetStaticBuffers()
469 … /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-113 */ in xQueueGenericGetStaticBuffers()
484 *ppucQueueStorage = ( uint8_t * ) pxQueue->pcHead; in xQueueGenericGetStaticBuffers()
498 /*-----------------------------------------------------------*/
516 ( ( UBaseType_t ) ( SIZE_MAX - sizeof( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) ) in xQueueGenericCreate()
524 … /* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */ in xQueueGenericCreate()
540 pxNewQueue->ucStaticallyAllocated = pdFALSE; in xQueueGenericCreate()
564 /*-----------------------------------------------------------*/
582 pxNewQueue->pcHead = ( int8_t * ) pxNewQueue; in prvInitialiseNewQueue()
587 pxNewQueue->pcHead = ( int8_t * ) pucQueueStorage; in prvInitialiseNewQueue()
592 pxNewQueue->uxLength = uxQueueLength; in prvInitialiseNewQueue()
593 pxNewQueue->uxItemSize = uxItemSize; in prvInitialiseNewQueue()
598 pxNewQueue->ucQueueType = ucQueueType; in prvInitialiseNewQueue()
604 pxNewQueue->pxQueueSetContainer = NULL; in prvInitialiseNewQueue()
610 /*-----------------------------------------------------------*/
620 * mutex. Overwrite those members that need to be set differently - in prvInitialiseMutex()
622 pxNewQueue->u.xSemaphore.xMutexHolder = NULL; in prvInitialiseMutex()
623 pxNewQueue->uxQueueType = queueQUEUE_IS_MUTEX; in prvInitialiseMutex()
626 pxNewQueue->u.xSemaphore.uxRecursiveCallCount = 0; in prvInitialiseMutex()
640 /*-----------------------------------------------------------*/
660 /*-----------------------------------------------------------*/
685 /*-----------------------------------------------------------*/
705 if( pxSemaphore->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueGetMutexHolder()
707 pxReturn = pxSemaphore->u.xSemaphore.xMutexHolder; in xQueueGetMutexHolder()
722 /*-----------------------------------------------------------*/
737 if( ( ( Queue_t * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueGetMutexHolderFromISR()
739 pxReturn = ( ( Queue_t * ) xSemaphore )->u.xSemaphore.xMutexHolder; in xQueueGetMutexHolderFromISR()
752 /*-----------------------------------------------------------*/
771 if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) in xQueueGiveMutexRecursive()
780 ( pxMutex->u.xSemaphore.uxRecursiveCallCount )--; in xQueueGiveMutexRecursive()
783 if( pxMutex->u.xSemaphore.uxRecursiveCallCount == ( UBaseType_t ) 0 ) in xQueueGiveMutexRecursive()
811 /*-----------------------------------------------------------*/
830 if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) in xQueueTakeMutexRecursive()
832 ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; in xQueueTakeMutexRecursive()
844 ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; in xQueueTakeMutexRecursive()
858 /*-----------------------------------------------------------*/
877 ( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount; in xQueueCreateCountingSemaphoreStatic()
898 /*-----------------------------------------------------------*/
916 ( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount; in xQueueCreateCountingSemaphore()
937 /*-----------------------------------------------------------*/
951 configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueGenericSend()
952 configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) ); in xQueueGenericSend()
967 … if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) ) in xQueueGenericSend()
973 const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueGenericSend()
977 if( pxQueue->pxQueueSetContainer != NULL ) in xQueueGenericSend()
1000 /* If there was a task waiting for data to arrive on the in xQueueGenericSend()
1002 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSend()
1004 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSend()
1008 * do this from within the critical section - the in xQueueGenericSend()
1035 /* If there was a task waiting for data to arrive on the in xQueueGenericSend()
1037 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSend()
1039 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSend()
1043 * this from within the critical section - the kernel in xQueueGenericSend()
1116 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait ); in xQueueGenericSend()
1120 * remove this task from the event list again - but as the in xQueueGenericSend()
1126 * ready list into the ready list - so it is feasible that this in xQueueGenericSend()
1127 * task is already in the ready list before it yields - in which in xQueueGenericSend()
1155 /*-----------------------------------------------------------*/
1169 configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueGenericSendFromISR()
1170 configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) ); in xQueueGenericSendFromISR()
1184 * More information (albeit Cortex-M specific) is provided on the following in xQueueGenericSendFromISR()
1185 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueueGenericSendFromISR()
1192 * post). */ in xQueueGenericSendFromISR()
1195 … if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) ) in xQueueGenericSendFromISR()
1197 const int8_t cTxLock = pxQueue->cTxLock; in xQueueGenericSendFromISR()
1198 const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueGenericSendFromISR()
1215 if( pxQueue->pxQueueSetContainer != NULL ) in xQueueGenericSendFromISR()
1245 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSendFromISR()
1247 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSendFromISR()
1273 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSendFromISR()
1275 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSendFromISR()
1306 * knows that data was posted while it was locked. */ in xQueueGenericSendFromISR()
1324 /*-----------------------------------------------------------*/
1339 * post). */ in xQueueGiveFromISR()
1345 configASSERT( pxQueue->uxItemSize == 0 ); in xQueueGiveFromISR()
1350 …configASSERT( !( ( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) && ( pxQueue->u.xSemaphore.xMutex… in xQueueGiveFromISR()
1364 * More information (albeit Cortex-M specific) is provided on the following in xQueueGiveFromISR()
1365 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueueGiveFromISR()
1370 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueGiveFromISR()
1372 /* When the queue is used to implement a semaphore no data is ever in xQueueGiveFromISR()
1375 if( uxMessagesWaiting < pxQueue->uxLength ) in xQueueGiveFromISR()
1377 const int8_t cTxLock = pxQueue->cTxLock; in xQueueGiveFromISR()
1382 * holder - and if there is a mutex holder then the mutex cannot be in xQueueGiveFromISR()
1387 pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting + ( UBaseType_t ) 1 ); in xQueueGiveFromISR()
1395 if( pxQueue->pxQueueSetContainer != NULL ) in xQueueGiveFromISR()
1418 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGiveFromISR()
1420 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGiveFromISR()
1446 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGiveFromISR()
1448 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGiveFromISR()
1476 * knows that data was posted while it was locked. */ in xQueueGiveFromISR()
1494 /*-----------------------------------------------------------*/
1509 /* The buffer into which data is received can only be NULL if the data size in xQueueReceive()
1510 * is zero (so no data is copied into the buffer). */ in xQueueReceive()
1511 …configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueReceive()
1524 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueReceive()
1526 /* Is there data in the queue now? To be running the calling task in xQueueReceive()
1530 /* Data available, remove one item. */ in xQueueReceive()
1533 … pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting - ( UBaseType_t ) 1 ); in xQueueReceive()
1536 * post to the queue? If so, unblock the highest priority waiting in xQueueReceive()
1538 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueReceive()
1540 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueReceive()
1603 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); in xQueueReceive()
1617 /* The queue contains data again. Loop back to try and read the in xQueueReceive()
1618 * data. */ in xQueueReceive()
1625 /* Timed out. If there is no data in the queue exit, otherwise loop in xQueueReceive()
1626 * back and attempt to read the data. */ in xQueueReceive()
1644 /*-----------------------------------------------------------*/
1664 configASSERT( pxQueue->uxItemSize == 0 ); in xQueueSemaphoreTake()
1679 const UBaseType_t uxSemaphoreCount = pxQueue->uxMessagesWaiting; in xQueueSemaphoreTake()
1681 /* Is there data in the queue now? To be running the calling task in xQueueSemaphoreTake()
1687 /* Semaphores are queues with a data size of zero and where the in xQueueSemaphoreTake()
1689 … pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxSemaphoreCount - ( UBaseType_t ) 1 ); in xQueueSemaphoreTake()
1693 if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueSemaphoreTake()
1697 pxQueue->u.xSemaphore.xMutexHolder = pvTaskIncrementMutexHeldCount(); in xQueueSemaphoreTake()
1708 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueSemaphoreTake()
1710 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueSemaphoreTake()
1778 if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueSemaphoreTake()
1782 … xInheritanceOccurred = xTaskPriorityInherit( pxQueue->u.xSemaphore.xMutexHolder ); in xQueueSemaphoreTake()
1793 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); in xQueueSemaphoreTake()
1828 * pxQueue->uxQueueType == queueQUEUE_IS_MUTEX so no need to in xQueueSemaphoreTake()
1846 * it can result in out-of-bounds access which is not true because in xQueueSemaphoreTake()
1848 * is capped at ( configMAX_PRIORITIES - 1 ). */ in xQueueSemaphoreTake()
1850 …vTaskPriorityDisinheritAfterTimeout( pxQueue->u.xSemaphore.xMutexHolder, uxHighestWaitingPriority … in xQueueSemaphoreTake()
1869 /*-----------------------------------------------------------*/
1885 /* The buffer into which data is received can only be NULL if the data size in xQueuePeek()
1886 * is zero (so no data is copied into the buffer. */ in xQueuePeek()
1887 …configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueuePeek()
1900 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueuePeek()
1902 /* Is there data in the queue now? To be running the calling task in xQueuePeek()
1906 /* Remember the read position so it can be reset after the data in xQueuePeek()
1908 * data, not removing it. */ in xQueuePeek()
1909 pcOriginalReadPosition = pxQueue->u.xQueue.pcReadFrom; in xQueuePeek()
1914 /* The data is not being removed, so reset the read pointer. */ in xQueuePeek()
1915 pxQueue->u.xQueue.pcReadFrom = pcOriginalReadPosition; in xQueuePeek()
1917 /* The data is being left in the queue, so see if there are in xQueuePeek()
1918 * any other tasks waiting for the data. */ in xQueuePeek()
1919 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueuePeek()
1921 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueuePeek()
1981 /* Timeout has not expired yet, check to see if there is data in the in xQueuePeek()
1982 * queue now, and if not enter the Blocked state to wait for data. */ in xQueuePeek()
1986 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); in xQueuePeek()
2000 /* There is data in the queue now, so don't enter the blocked in xQueuePeek()
2001 * state, instead return to try and obtain the data. */ in xQueuePeek()
2008 /* The timeout has expired. If there is still no data in the queue in xQueuePeek()
2009 * exit, otherwise go back and try to read the data again. */ in xQueuePeek()
2027 /*-----------------------------------------------------------*/
2040 configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueReceiveFromISR()
2054 * More information (albeit Cortex-M specific) is provided on the following in xQueueReceiveFromISR()
2055 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueueReceiveFromISR()
2060 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueReceiveFromISR()
2062 /* Cannot block in an ISR, so check there is data available. */ in xQueueReceiveFromISR()
2065 const int8_t cRxLock = pxQueue->cRxLock; in xQueueReceiveFromISR()
2070 pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting - ( UBaseType_t ) 1 ); in xQueueReceiveFromISR()
2074 * will know that an ISR has removed data while the queue was in xQueueReceiveFromISR()
2078 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueReceiveFromISR()
2080 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueReceiveFromISR()
2106 * knows that data was removed while it was locked. */ in xQueueReceiveFromISR()
2124 /*-----------------------------------------------------------*/
2137 configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueuePeekFromISR()
2138 configASSERT( pxQueue->uxItemSize != 0 ); /* Can't peek a semaphore. */ in xQueuePeekFromISR()
2152 * More information (albeit Cortex-M specific) is provided on the following in xQueuePeekFromISR()
2153 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueuePeekFromISR()
2158 /* Cannot block in an ISR, so check there is data available. */ in xQueuePeekFromISR()
2159 if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 ) in xQueuePeekFromISR()
2165 pcOriginalReadPosition = pxQueue->u.xQueue.pcReadFrom; in xQueuePeekFromISR()
2167 pxQueue->u.xQueue.pcReadFrom = pcOriginalReadPosition; in xQueuePeekFromISR()
2183 /*-----------------------------------------------------------*/
2195 uxReturn = ( ( Queue_t * ) xQueue )->uxMessagesWaiting; in uxQueueMessagesWaiting()
2203 /*-----------------------------------------------------------*/
2216 uxReturn = ( UBaseType_t ) ( pxQueue->uxLength - pxQueue->uxMessagesWaiting ); in uxQueueSpacesAvailable()
2224 /*-----------------------------------------------------------*/
2234 uxReturn = pxQueue->uxMessagesWaiting; in uxQueueMessagesWaitingFromISR()
2240 /*-----------------------------------------------------------*/
2259 /* The queue can only have been allocated dynamically - free it in vQueueDelete()
2267 if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdFALSE ) in vQueueDelete()
2286 /*-----------------------------------------------------------*/
2294 traceRETURN_uxQueueGetQueueNumber( ( ( Queue_t * ) xQueue )->uxQueueNumber ); in uxQueueGetQueueNumber()
2296 return ( ( Queue_t * ) xQueue )->uxQueueNumber; in uxQueueGetQueueNumber()
2300 /*-----------------------------------------------------------*/
2309 ( ( Queue_t * ) xQueue )->uxQueueNumber = uxQueueNumber; in vQueueSetQueueNumber()
2315 /*-----------------------------------------------------------*/
2323 traceRETURN_ucQueueGetQueueType( ( ( Queue_t * ) xQueue )->ucQueueType ); in ucQueueGetQueueType()
2325 return ( ( Queue_t * ) xQueue )->ucQueueType; in ucQueueGetQueueType()
2329 /*-----------------------------------------------------------*/
2335 traceRETURN_uxQueueGetQueueItemSize( ( ( Queue_t * ) xQueue )->uxItemSize ); in uxQueueGetQueueItemSize()
2337 return ( ( Queue_t * ) xQueue )->uxItemSize; in uxQueueGetQueueItemSize()
2339 /*-----------------------------------------------------------*/
2345 traceRETURN_uxQueueGetQueueLength( ( ( Queue_t * ) xQueue )->uxLength ); in uxQueueGetQueueLength()
2347 return ( ( Queue_t * ) xQueue )->uxLength; in uxQueueGetQueueLength()
2349 /*-----------------------------------------------------------*/
2359 * disinherit the priority - but only down to the highest priority of any in prvGetDisinheritPriorityAfterTimeout()
2363 if( listCURRENT_LIST_LENGTH( &( pxQueue->xTasksWaitingToReceive ) ) > 0U ) in prvGetDisinheritPriorityAfterTimeout()
2365 …e_t ) ( ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) listGET_ITEM_VALUE_OF_HEAD_ENTRY( &… in prvGetDisinheritPriorityAfterTimeout()
2376 /*-----------------------------------------------------------*/
2387 uxMessagesWaiting = pxQueue->uxMessagesWaiting; in prvCopyDataToQueue()
2389 if( pxQueue->uxItemSize == ( UBaseType_t ) 0 ) in prvCopyDataToQueue()
2393 if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) in prvCopyDataToQueue()
2396 xReturn = xTaskPriorityDisinherit( pxQueue->u.xSemaphore.xMutexHolder ); in prvCopyDataToQueue()
2397 pxQueue->u.xSemaphore.xMutexHolder = NULL; in prvCopyDataToQueue()
2408 … ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); in prvCopyDataToQueue()
2409 pxQueue->pcWriteTo += pxQueue->uxItemSize; in prvCopyDataToQueue()
2411 if( pxQueue->pcWriteTo >= pxQueue->u.xQueue.pcTail ) in prvCopyDataToQueue()
2413 pxQueue->pcWriteTo = pxQueue->pcHead; in prvCopyDataToQueue()
2422 …( void ) memcpy( ( void * ) pxQueue->u.xQueue.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxIte… in prvCopyDataToQueue()
2423 pxQueue->u.xQueue.pcReadFrom -= pxQueue->uxItemSize; in prvCopyDataToQueue()
2425 if( pxQueue->u.xQueue.pcReadFrom < pxQueue->pcHead ) in prvCopyDataToQueue()
2427 pxQueue->u.xQueue.pcReadFrom = ( pxQueue->u.xQueue.pcTail - pxQueue->uxItemSize ); in prvCopyDataToQueue()
2442 --uxMessagesWaiting; in prvCopyDataToQueue()
2455 pxQueue->uxMessagesWaiting = ( UBaseType_t ) ( uxMessagesWaiting + ( UBaseType_t ) 1 ); in prvCopyDataToQueue()
2459 /*-----------------------------------------------------------*/
2464 if( pxQueue->uxItemSize != ( UBaseType_t ) 0 ) in prvCopyDataFromQueue()
2466 pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; in prvCopyDataFromQueue()
2468 if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) in prvCopyDataFromQueue()
2470 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead; in prvCopyDataFromQueue()
2477 … void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( size_t ) pxQueue->… in prvCopyDataFromQueue()
2480 /*-----------------------------------------------------------*/
2486 /* The lock counts contains the number of extra data items placed or in prvUnlockQueue()
2492 int8_t cTxLock = pxQueue->cTxLock; in prvUnlockQueue()
2494 /* See if data was added to the queue while it was locked. */ in prvUnlockQueue()
2497 /* Data was posted while the queue was locked. Are any tasks in prvUnlockQueue()
2498 * blocked waiting for data to become available? */ in prvUnlockQueue()
2501 if( pxQueue->pxQueueSetContainer != NULL ) in prvUnlockQueue()
2520 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in prvUnlockQueue()
2522 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in prvUnlockQueue()
2543 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in prvUnlockQueue()
2545 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in prvUnlockQueue()
2563 --cTxLock; in prvUnlockQueue()
2566 pxQueue->cTxLock = queueUNLOCKED; in prvUnlockQueue()
2573 int8_t cRxLock = pxQueue->cRxLock; in prvUnlockQueue()
2577 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in prvUnlockQueue()
2579 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in prvUnlockQueue()
2588 --cRxLock; in prvUnlockQueue()
2596 pxQueue->cRxLock = queueUNLOCKED; in prvUnlockQueue()
2600 /*-----------------------------------------------------------*/
2608 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 ) in prvIsQueueEmpty()
2621 /*-----------------------------------------------------------*/
2632 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 ) in xQueueIsQueueEmptyFromISR()
2645 /*-----------------------------------------------------------*/
2653 if( pxQueue->uxMessagesWaiting == pxQueue->uxLength ) in prvIsQueueFull()
2666 /*-----------------------------------------------------------*/
2677 if( pxQueue->uxMessagesWaiting == pxQueue->uxLength ) in xQueueIsQueueFullFromISR()
2690 /*-----------------------------------------------------------*/
2710 /* The queue is full - do we want to block or just leave without in xQueueCRSend()
2716 vCoRoutineAddToDelayedList( xTicksToWait, &( pxQueue->xTasksWaitingToSend ) ); in xQueueCRSend()
2731 if( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) in xQueueCRSend()
2733 /* There is room in the queue, copy the data into the queue. */ in xQueueCRSend()
2737 /* Were any co-routines waiting for data to become available? */ in xQueueCRSend()
2738 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueCRSend()
2740 /* In this instance the co-routine could be placed directly in xQueueCRSend()
2744 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueCRSend()
2746 /* The co-routine waiting has a higher priority so record in xQueueCRSend()
2773 /*-----------------------------------------------------------*/
2791 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 ) in xQueueCRReceive()
2797 /* As this is a co-routine we cannot block directly, but return in xQueueCRReceive()
2799 … vCoRoutineAddToDelayedList( xTicksToWait, &( pxQueue->xTasksWaitingToReceive ) ); in xQueueCRReceive()
2818 if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 ) in xQueueCRReceive()
2820 /* Data is available from the queue. */ in xQueueCRReceive()
2821 pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; in xQueueCRReceive()
2823 if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) in xQueueCRReceive()
2825 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead; in xQueueCRReceive()
2832 --( pxQueue->uxMessagesWaiting ); in xQueueCRReceive()
2833 …void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( unsigned ) pxQueue-… in xQueueCRReceive()
2837 /* Were any co-routines waiting for space to become available? */ in xQueueCRReceive()
2838 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueCRReceive()
2840 /* In this instance the co-routine could be placed directly in xQueueCRReceive()
2844 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueCRReceive()
2871 /*-----------------------------------------------------------*/
2885 if( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) in xQueueCRSendFromISR()
2889 /* We only want to wake one co-routine per ISR, so check that a in xQueueCRSendFromISR()
2890 * co-routine has not already been woken. */ in xQueueCRSendFromISR()
2893 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueCRSendFromISR()
2895 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueCRSendFromISR()
2925 /*-----------------------------------------------------------*/
2938 /* We cannot block from an ISR, so check there is data available. If in xQueueCRReceiveFromISR()
2940 if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 ) in xQueueCRReceiveFromISR()
2942 /* Copy the data from the queue. */ in xQueueCRReceiveFromISR()
2943 pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; in xQueueCRReceiveFromISR()
2945 if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) in xQueueCRReceiveFromISR()
2947 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead; in xQueueCRReceiveFromISR()
2954 --( pxQueue->uxMessagesWaiting ); in xQueueCRReceiveFromISR()
2955 …void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( unsigned ) pxQueue-… in xQueueCRReceiveFromISR()
2959 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueCRReceiveFromISR()
2961 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueCRReceiveFromISR()
2993 /*-----------------------------------------------------------*/
3034 pxEntryToWrite->pcQueueName = pcQueueName; in vQueueAddToRegistry()
3035 pxEntryToWrite->xHandle = xQueue; in vQueueAddToRegistry()
3044 /*-----------------------------------------------------------*/
3079 /*-----------------------------------------------------------*/
3116 /*-----------------------------------------------------------*/
3138 * list. It will not block until the scheduler is unlocked - at which in vQueueWaitForMessageRestricted()
3144 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0U ) in vQueueWaitForMessageRestricted()
3147 …vTaskPlaceOnEventListRestricted( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait, xWaitIndefini… in vQueueWaitForMessageRestricted()
3160 /*-----------------------------------------------------------*/
3178 /*-----------------------------------------------------------*/
3191 if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL ) in xQueueAddToSet()
3196 else if( ( ( Queue_t * ) xQueueOrSemaphore )->uxMessagesWaiting != ( UBaseType_t ) 0 ) in xQueueAddToSet()
3204 ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet; in xQueueAddToSet()
3216 /*-----------------------------------------------------------*/
3228 if( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet ) in xQueueRemoveFromSet()
3233 else if( pxQueueOrSemaphore->uxMessagesWaiting != ( UBaseType_t ) 0 ) in xQueueRemoveFromSet()
3245 pxQueueOrSemaphore->pxQueueSetContainer = NULL; in xQueueRemoveFromSet()
3257 /*-----------------------------------------------------------*/
3276 /*-----------------------------------------------------------*/
3294 /*-----------------------------------------------------------*/
3300 Queue_t * pxQueueSetContainer = pxQueue->pxQueueSetContainer; in prvNotifyQueueSetContainer()
3309 configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength ); in prvNotifyQueueSetContainer()
3311 if( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength ) in prvNotifyQueueSetContainer()
3313 const int8_t cTxLock = pxQueueSetContainer->cTxLock; in prvNotifyQueueSetContainer()
3317 /* The data copied is the handle of the queue that contains data. */ in prvNotifyQueueSetContainer()
3322 … if( listLIST_IS_EMPTY( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) == pdFALSE ) in prvNotifyQueueSetContainer()
3324 … if( xTaskRemoveFromEventList( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) != pdFALSE ) in prvNotifyQueueSetContainer()