Lines Matching +full:- +full:- +full:check

5  * SPDX-License-Identifier: MIT
53 #define queueUNLOCKED ( ( int8_t ) -1 )
98 * rationale: https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
139 /*-----------------------------------------------------------*/
239 * disinherit the priority - but only down to the highest priority of any
245 /*-----------------------------------------------------------*/
254 if( ( pxQueue )->cRxLock == queueUNLOCKED ) \
256 ( pxQueue )->cRxLock = queueLOCKED_UNMODIFIED; \
258 if( ( pxQueue )->cTxLock == queueUNLOCKED ) \
260 ( pxQueue )->cTxLock = queueLOCKED_UNMODIFIED; \
276 ( pxQueue )->cTxLock = ( int8_t ) ( ( cTxLock ) + ( int8_t ) 1 ); \
291 ( pxQueue )->cRxLock = ( int8_t ) ( ( cRxLock ) + ( int8_t ) 1 ); \
294 /*-----------------------------------------------------------*/
305 ( pxQueue->uxLength >= 1U ) && in xQueueGenericReset()
306 /* Check for multiplication overflow. */ in xQueueGenericReset()
307 ( ( SIZE_MAX / pxQueue->uxLength ) >= pxQueue->uxItemSize ) ) in xQueueGenericReset()
311 …pxQueue->u.xQueue.pcTail = pxQueue->pcHead + ( pxQueue->uxLength * pxQueue->uxItemSize ); /*lint !… in xQueueGenericReset()
312 pxQueue->uxMessagesWaiting = ( UBaseType_t ) 0U; in xQueueGenericReset()
313 pxQueue->pcWriteTo = pxQueue->pcHead; in xQueueGenericReset()
314 …pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead + ( ( pxQueue->uxLength - 1U ) * pxQueue->uxItemSiz… in xQueueGenericReset()
315 pxQueue->cRxLock = queueUNLOCKED; in xQueueGenericReset()
316 pxQueue->cTxLock = queueUNLOCKED; in xQueueGenericReset()
325 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueGenericReset()
327 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueGenericReset()
344 vListInitialise( &( pxQueue->xTasksWaitingToSend ) ); in xQueueGenericReset()
345 vListInitialise( &( pxQueue->xTasksWaitingToReceive ) ); in xQueueGenericReset()
361 /*-----------------------------------------------------------*/
387 /* Sanity check that the size of the structure used to declare a in xQueueGenericCreateStatic()
408 pxNewQueue->ucStaticallyAllocated = pdTRUE; in xQueueGenericCreateStatic()
424 /*-----------------------------------------------------------*/
440 /* Check if the queue was statically allocated. */ in xQueueGenericGetStaticBuffers()
441 if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdTRUE ) in xQueueGenericGetStaticBuffers()
445 *ppucQueueStorage = ( uint8_t * ) pxQueue->pcHead; in xQueueGenericGetStaticBuffers()
461 *ppucQueueStorage = ( uint8_t * ) pxQueue->pcHead; in xQueueGenericGetStaticBuffers()
473 /*-----------------------------------------------------------*/
486 /* Check for multiplication overflow. */ in xQueueGenericCreate()
488 /* Check for addition overflow. */ in xQueueGenericCreate()
489 ( ( SIZE_MAX - sizeof( Queue_t ) ) >= ( uxQueueLength * uxItemSize ) ) ) in xQueueGenericCreate()
500 * alignment requirements of the Queue_t structure - which in this case in xQueueGenericCreate()
519 pxNewQueue->ucStaticallyAllocated = pdFALSE; in xQueueGenericCreate()
541 /*-----------------------------------------------------------*/
559 pxNewQueue->pcHead = ( int8_t * ) pxNewQueue; in prvInitialiseNewQueue()
564 pxNewQueue->pcHead = ( int8_t * ) pucQueueStorage; in prvInitialiseNewQueue()
569 pxNewQueue->uxLength = uxQueueLength; in prvInitialiseNewQueue()
570 pxNewQueue->uxItemSize = uxItemSize; in prvInitialiseNewQueue()
575 pxNewQueue->ucQueueType = ucQueueType; in prvInitialiseNewQueue()
581 pxNewQueue->pxQueueSetContainer = NULL; in prvInitialiseNewQueue()
587 /*-----------------------------------------------------------*/
597 * mutex. Overwrite those members that need to be set differently - in prvInitialiseMutex()
599 pxNewQueue->u.xSemaphore.xMutexHolder = NULL; in prvInitialiseMutex()
600 pxNewQueue->uxQueueType = queueQUEUE_IS_MUTEX; in prvInitialiseMutex()
603 pxNewQueue->u.xSemaphore.uxRecursiveCallCount = 0; in prvInitialiseMutex()
617 /*-----------------------------------------------------------*/
633 /*-----------------------------------------------------------*/
654 /*-----------------------------------------------------------*/
672 if( pxSemaphore->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueGetMutexHolder()
674 pxReturn = pxSemaphore->u.xSemaphore.xMutexHolder; in xQueueGetMutexHolder()
687 /*-----------------------------------------------------------*/
700 if( ( ( Queue_t * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueGetMutexHolderFromISR()
702 pxReturn = ( ( Queue_t * ) xSemaphore )->u.xSemaphore.xMutexHolder; in xQueueGetMutexHolderFromISR()
713 /*-----------------------------------------------------------*/
730 if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) in xQueueGiveMutexRecursive()
735 * the task handle, therefore no underflow check is required. Also, in xQueueGiveMutexRecursive()
739 ( pxMutex->u.xSemaphore.uxRecursiveCallCount )--; in xQueueGiveMutexRecursive()
742 if( pxMutex->u.xSemaphore.uxRecursiveCallCount == ( UBaseType_t ) 0 ) in xQueueGiveMutexRecursive()
768 /*-----------------------------------------------------------*/
785 if( pxMutex->u.xSemaphore.xMutexHolder == xTaskGetCurrentTaskHandle() ) in xQueueTakeMutexRecursive()
787 ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; in xQueueTakeMutexRecursive()
799 ( pxMutex->u.xSemaphore.uxRecursiveCallCount )++; in xQueueTakeMutexRecursive()
811 /*-----------------------------------------------------------*/
828 ( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount; in xQueueCreateCountingSemaphoreStatic()
847 /*-----------------------------------------------------------*/
863 ( ( Queue_t * ) xHandle )->uxMessagesWaiting = uxInitialCount; in xQueueCreateCountingSemaphore()
882 /*-----------------------------------------------------------*/
894 configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueGenericSend()
895 configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) ); in xQueueGenericSend()
902 /*lint -save -e904 This function relaxes the coding standard somewhat to in xQueueGenericSend()
913 … if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) ) in xQueueGenericSend()
919 const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueGenericSend()
923 if( pxQueue->pxQueueSetContainer != NULL ) in xQueueGenericSend()
948 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSend()
950 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSend()
954 * do this from within the critical section - the in xQueueGenericSend()
983 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSend()
985 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSend()
989 * this from within the critical section - the kernel in xQueueGenericSend()
1057 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait ); in xQueueGenericSend()
1061 * remove this task from the event list again - but as the in xQueueGenericSend()
1067 * ready list into the ready list - so it is feasible that this in xQueueGenericSend()
1068 * task is already in the ready list before it yields - in which in xQueueGenericSend()
1092 } /*lint -restore */ in xQueueGenericSend()
1094 /*-----------------------------------------------------------*/
1106 configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueGenericSendFromISR()
1107 configASSERT( !( ( xCopyPosition == queueOVERWRITE ) && ( pxQueue->uxLength != 1 ) ) ); in xQueueGenericSendFromISR()
1121 * More information (albeit Cortex-M specific) is provided on the following in xQueueGenericSendFromISR()
1122 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueueGenericSendFromISR()
1132 … if( ( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) || ( xCopyPosition == queueOVERWRITE ) ) in xQueueGenericSendFromISR()
1134 const int8_t cTxLock = pxQueue->cTxLock; in xQueueGenericSendFromISR()
1135 const UBaseType_t uxPreviousMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueGenericSendFromISR()
1142 * called here even though the disinherit function does not check if in xQueueGenericSendFromISR()
1152 if( pxQueue->pxQueueSetContainer != NULL ) in xQueueGenericSendFromISR()
1182 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSendFromISR()
1184 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSendFromISR()
1210 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGenericSendFromISR()
1212 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGenericSendFromISR()
1259 /*-----------------------------------------------------------*/
1278 configASSERT( pxQueue->uxItemSize == 0 ); in xQueueGiveFromISR()
1283 …configASSERT( !( ( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) && ( pxQueue->u.xSemaphore.xMutex… in xQueueGiveFromISR()
1297 * More information (albeit Cortex-M specific) is provided on the following in xQueueGiveFromISR()
1298 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueueGiveFromISR()
1303 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueGiveFromISR()
1308 if( uxMessagesWaiting < pxQueue->uxLength ) in xQueueGiveFromISR()
1310 const int8_t cTxLock = pxQueue->cTxLock; in xQueueGiveFromISR()
1315 * holder - and if there is a mutex holder then the mutex cannot be in xQueueGiveFromISR()
1320 pxQueue->uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1; in xQueueGiveFromISR()
1328 if( pxQueue->pxQueueSetContainer != NULL ) in xQueueGiveFromISR()
1351 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGiveFromISR()
1353 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGiveFromISR()
1379 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueGiveFromISR()
1381 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueGiveFromISR()
1425 /*-----------------------------------------------------------*/
1435 /* Check the pointer is not NULL. */ in xQueueReceive()
1440 …configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueReceive()
1449 /*lint -save -e904 This function relaxes the coding standard somewhat to in xQueueReceive()
1456 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueReceive()
1465 pxQueue->uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1; in xQueueReceive()
1470 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueReceive()
1472 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueReceive()
1529 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); in xQueueReceive()
1566 } /*lint -restore */ in xQueueReceive()
1568 /*-----------------------------------------------------------*/
1581 /* Check the queue pointer is not NULL. */ in xQueueSemaphoreTake()
1584 /* Check this really is a semaphore, in which case the item size will be in xQueueSemaphoreTake()
1586 configASSERT( pxQueue->uxItemSize == 0 ); in xQueueSemaphoreTake()
1595 /*lint -save -e904 This function relaxes the coding standard somewhat to allow return in xQueueSemaphoreTake()
1604 const UBaseType_t uxSemaphoreCount = pxQueue->uxMessagesWaiting; in xQueueSemaphoreTake()
1614 pxQueue->uxMessagesWaiting = uxSemaphoreCount - ( UBaseType_t ) 1; in xQueueSemaphoreTake()
1618 if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueSemaphoreTake()
1622 pxQueue->u.xSemaphore.xMutexHolder = pvTaskIncrementMutexHeldCount(); in xQueueSemaphoreTake()
1631 /* Check to see if other tasks are blocked waiting to give the in xQueueSemaphoreTake()
1633 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueSemaphoreTake()
1635 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueSemaphoreTake()
1697 if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) in xQueueSemaphoreTake()
1701 … xInheritanceOccurred = xTaskPriorityInherit( pxQueue->u.xSemaphore.xMutexHolder ); in xQueueSemaphoreTake()
1712 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); in xQueueSemaphoreTake()
1747 * pxQueue->uxQueueType == queueQUEUE_IS_MUTEX so no need to in xQueueSemaphoreTake()
1748 * test the mutex type again to check it is actually a mutex. */ in xQueueSemaphoreTake()
1761 …vTaskPriorityDisinheritAfterTimeout( pxQueue->u.xSemaphore.xMutexHolder, uxHighestWaitingPriority … in xQueueSemaphoreTake()
1776 } /*lint -restore */ in xQueueSemaphoreTake()
1778 /*-----------------------------------------------------------*/
1789 /* Check the pointer is not NULL. */ in xQueuePeek()
1794 …configASSERT( !( ( ( pvBuffer ) == NULL ) && ( ( pxQueue )->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueuePeek()
1803 /*lint -save -e904 This function relaxes the coding standard somewhat to in xQueuePeek()
1810 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueuePeek()
1819 pcOriginalReadPosition = pxQueue->u.xQueue.pcReadFrom; in xQueuePeek()
1825 pxQueue->u.xQueue.pcReadFrom = pcOriginalReadPosition; in xQueuePeek()
1829 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueuePeek()
1831 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueuePeek()
1885 /* Timeout has not expired yet, check to see if there is data in the in xQueuePeek()
1890 vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); in xQueuePeek()
1927 } /*lint -restore */ in xQueuePeek()
1929 /*-----------------------------------------------------------*/
1940 configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueueReceiveFromISR()
1954 * More information (albeit Cortex-M specific) is provided on the following in xQueueReceiveFromISR()
1955 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueueReceiveFromISR()
1960 const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting; in xQueueReceiveFromISR()
1962 /* Cannot block in an ISR, so check there is data available. */ in xQueueReceiveFromISR()
1965 const int8_t cRxLock = pxQueue->cRxLock; in xQueueReceiveFromISR()
1970 pxQueue->uxMessagesWaiting = uxMessagesWaiting - ( UBaseType_t ) 1; in xQueueReceiveFromISR()
1978 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueReceiveFromISR()
1980 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueReceiveFromISR()
2022 /*-----------------------------------------------------------*/
2033 configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) ); in xQueuePeekFromISR()
2034 configASSERT( pxQueue->uxItemSize != 0 ); /* Can't peek a semaphore. */ in xQueuePeekFromISR()
2048 * More information (albeit Cortex-M specific) is provided on the following in xQueuePeekFromISR()
2049 * link: https://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html */ in xQueuePeekFromISR()
2054 /* Cannot block in an ISR, so check there is data available. */ in xQueuePeekFromISR()
2055 if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 ) in xQueuePeekFromISR()
2061 pcOriginalReadPosition = pxQueue->u.xQueue.pcReadFrom; in xQueuePeekFromISR()
2063 pxQueue->u.xQueue.pcReadFrom = pcOriginalReadPosition; in xQueuePeekFromISR()
2077 /*-----------------------------------------------------------*/
2087 uxReturn = ( ( Queue_t * ) xQueue )->uxMessagesWaiting; in uxQueueMessagesWaiting()
2093 /*-----------------------------------------------------------*/
2104 uxReturn = pxQueue->uxLength - pxQueue->uxMessagesWaiting; in uxQueueSpacesAvailable()
2110 /*-----------------------------------------------------------*/
2118 uxReturn = pxQueue->uxMessagesWaiting; in uxQueueMessagesWaitingFromISR()
2122 /*-----------------------------------------------------------*/
2139 /* The queue can only have been allocated dynamically - free it in vQueueDelete()
2146 * check before attempting to free the memory. */ in vQueueDelete()
2147 if( pxQueue->ucStaticallyAllocated == ( uint8_t ) pdFALSE ) in vQueueDelete()
2164 /*-----------------------------------------------------------*/
2170 return ( ( Queue_t * ) xQueue )->uxQueueNumber; in uxQueueGetQueueNumber()
2174 /*-----------------------------------------------------------*/
2181 ( ( Queue_t * ) xQueue )->uxQueueNumber = uxQueueNumber; in vQueueSetQueueNumber()
2185 /*-----------------------------------------------------------*/
2191 return ( ( Queue_t * ) xQueue )->ucQueueType; in ucQueueGetQueueType()
2195 /*-----------------------------------------------------------*/
2199 return ( ( Queue_t * ) xQueue )->uxItemSize; in uxQueueGetQueueItemSize()
2201 /*-----------------------------------------------------------*/
2205 return ( ( Queue_t * ) xQueue )->uxLength; in uxQueueGetQueueLength()
2207 /*-----------------------------------------------------------*/
2217 * disinherit the priority - but only down to the highest priority of any in prvGetDisinheritPriorityAfterTimeout()
2221 if( listCURRENT_LIST_LENGTH( &( pxQueue->xTasksWaitingToReceive ) ) > 0U ) in prvGetDisinheritPriorityAfterTimeout()
2223 …Tasks = ( UBaseType_t ) configMAX_PRIORITIES - ( UBaseType_t ) listGET_ITEM_VALUE_OF_HEAD_ENTRY( &… in prvGetDisinheritPriorityAfterTimeout()
2234 /*-----------------------------------------------------------*/
2245 uxMessagesWaiting = pxQueue->uxMessagesWaiting; in prvCopyDataToQueue()
2247 if( pxQueue->uxItemSize == ( UBaseType_t ) 0 ) in prvCopyDataToQueue()
2251 if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX ) in prvCopyDataToQueue()
2254 xReturn = xTaskPriorityDisinherit( pxQueue->u.xSemaphore.xMutexHolder ); in prvCopyDataToQueue()
2255 pxQueue->u.xSemaphore.xMutexHolder = NULL; in prvCopyDataToQueue()
2266 …( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /… in prvCopyDataToQueue()
2267 …pxQueue->pcWriteTo += pxQueue->uxItemSize; /… in prvCopyDataToQueue()
2269 …if( pxQueue->pcWriteTo >= pxQueue->u.xQueue.pcTail ) /… in prvCopyDataToQueue()
2271 pxQueue->pcWriteTo = pxQueue->pcHead; in prvCopyDataToQueue()
2280 …( void ) memcpy( ( void * ) pxQueue->u.xQueue.pcReadFrom, pvItemToQueue, ( size_t ) pxQueue->uxIte… in prvCopyDataToQueue()
2281 pxQueue->u.xQueue.pcReadFrom -= pxQueue->uxItemSize; in prvCopyDataToQueue()
2283 …if( pxQueue->u.xQueue.pcReadFrom < pxQueue->pcHead ) /*lint !e946 MISRA exception justified as com… in prvCopyDataToQueue()
2285 pxQueue->u.xQueue.pcReadFrom = ( pxQueue->u.xQueue.pcTail - pxQueue->uxItemSize ); in prvCopyDataToQueue()
2300 --uxMessagesWaiting; in prvCopyDataToQueue()
2313 pxQueue->uxMessagesWaiting = uxMessagesWaiting + ( UBaseType_t ) 1; in prvCopyDataToQueue()
2317 /*-----------------------------------------------------------*/
2322 if( pxQueue->uxItemSize != ( UBaseType_t ) 0 ) in prvCopyDataFromQueue()
2324 …pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; /*lint !e9016 Pointer arithmetic on… in prvCopyDataFromQueue()
2326 …if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) /*lint !e946 MISRA exception justif… in prvCopyDataFromQueue()
2328 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead; in prvCopyDataFromQueue()
2335 … void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( size_t ) pxQueue->… in prvCopyDataFromQueue()
2338 /*-----------------------------------------------------------*/
2350 int8_t cTxLock = pxQueue->cTxLock; in prvUnlockQueue()
2359 if( pxQueue->pxQueueSetContainer != NULL ) in prvUnlockQueue()
2378 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in prvUnlockQueue()
2380 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in prvUnlockQueue()
2401 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in prvUnlockQueue()
2403 … if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in prvUnlockQueue()
2421 --cTxLock; in prvUnlockQueue()
2424 pxQueue->cTxLock = queueUNLOCKED; in prvUnlockQueue()
2431 int8_t cRxLock = pxQueue->cRxLock; in prvUnlockQueue()
2435 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in prvUnlockQueue()
2437 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in prvUnlockQueue()
2446 --cRxLock; in prvUnlockQueue()
2454 pxQueue->cRxLock = queueUNLOCKED; in prvUnlockQueue()
2458 /*-----------------------------------------------------------*/
2466 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 ) in prvIsQueueEmpty()
2479 /*-----------------------------------------------------------*/
2488 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 ) in xQueueIsQueueEmptyFromISR()
2499 /*-----------------------------------------------------------*/
2507 if( pxQueue->uxMessagesWaiting == pxQueue->uxLength ) in prvIsQueueFull()
2520 /*-----------------------------------------------------------*/
2529 if( pxQueue->uxMessagesWaiting == pxQueue->uxLength ) in xQueueIsQueueFullFromISR()
2540 /*-----------------------------------------------------------*/
2553 * between the check to see if the queue is full and blocking on the queue. */ in xQueueCRSend()
2558 /* The queue is full - do we want to block or just leave without in xQueueCRSend()
2564 vCoRoutineAddToDelayedList( xTicksToWait, &( pxQueue->xTasksWaitingToSend ) ); in xQueueCRSend()
2579 if( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) in xQueueCRSend()
2585 /* Were any co-routines waiting for data to become available? */ in xQueueCRSend()
2586 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueCRSend()
2588 /* In this instance the co-routine could be placed directly in xQueueCRSend()
2592 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueCRSend()
2594 /* The co-routine waiting has a higher priority so record in xQueueCRSend()
2619 /*-----------------------------------------------------------*/
2632 * between the check to see if the queue is empty and blocking on the queue. */ in xQueueCRReceive()
2635 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0 ) in xQueueCRReceive()
2641 /* As this is a co-routine we cannot block directly, but return in xQueueCRReceive()
2643 … vCoRoutineAddToDelayedList( xTicksToWait, &( pxQueue->xTasksWaitingToReceive ) ); in xQueueCRReceive()
2662 if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 ) in xQueueCRReceive()
2665 pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; in xQueueCRReceive()
2667 if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) in xQueueCRReceive()
2669 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead; in xQueueCRReceive()
2676 --( pxQueue->uxMessagesWaiting ); in xQueueCRReceive()
2677 …void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( unsigned ) pxQueue- in xQueueCRReceive()
2681 /* Were any co-routines waiting for space to become available? */ in xQueueCRReceive()
2682 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueCRReceive()
2684 /* In this instance the co-routine could be placed directly in xQueueCRReceive()
2688 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueCRReceive()
2713 /*-----------------------------------------------------------*/
2725 if( pxQueue->uxMessagesWaiting < pxQueue->uxLength ) in xQueueCRSendFromISR()
2729 /* We only want to wake one co-routine per ISR, so check that a in xQueueCRSendFromISR()
2730 * co-routine has not already been woken. */ in xQueueCRSendFromISR()
2733 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) in xQueueCRSendFromISR()
2735 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE ) in xQueueCRSendFromISR()
2763 /*-----------------------------------------------------------*/
2774 /* We cannot block from an ISR, so check there is data available. If in xQueueCRReceiveFromISR()
2776 if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 ) in xQueueCRReceiveFromISR()
2779 pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; in xQueueCRReceiveFromISR()
2781 if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) in xQueueCRReceiveFromISR()
2783 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead; in xQueueCRReceiveFromISR()
2790 --( pxQueue->uxMessagesWaiting ); in xQueueCRReceiveFromISR()
2791 …void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( unsigned ) pxQueue- in xQueueCRReceiveFromISR()
2795 if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) in xQueueCRReceiveFromISR()
2797 … if( xCoRoutineRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE ) in xQueueCRReceiveFromISR()
2827 /*-----------------------------------------------------------*/
2866 pxEntryToWrite->pcQueueName = pcQueueName; in vQueueAddToRegistry()
2867 pxEntryToWrite->xHandle = xQueue; in vQueueAddToRegistry()
2874 /*-----------------------------------------------------------*/
2905 /*-----------------------------------------------------------*/
2938 /*-----------------------------------------------------------*/
2958 * list. It will not block until the scheduler is unlocked - at which in vQueueWaitForMessageRestricted()
2964 if( pxQueue->uxMessagesWaiting == ( UBaseType_t ) 0U ) in vQueueWaitForMessageRestricted()
2967 …vTaskPlaceOnEventListRestricted( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait, xWaitIndefini… in vQueueWaitForMessageRestricted()
2978 /*-----------------------------------------------------------*/
2992 /*-----------------------------------------------------------*/
3003 if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL ) in xQueueAddToSet()
3008 else if( ( ( Queue_t * ) xQueueOrSemaphore )->uxMessagesWaiting != ( UBaseType_t ) 0 ) in xQueueAddToSet()
3016 ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet; in xQueueAddToSet()
3026 /*-----------------------------------------------------------*/
3036 if( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet ) in xQueueRemoveFromSet()
3041 else if( pxQueueOrSemaphore->uxMessagesWaiting != ( UBaseType_t ) 0 ) in xQueueRemoveFromSet()
3053 pxQueueOrSemaphore->pxQueueSetContainer = NULL; in xQueueRemoveFromSet()
3063 /*-----------------------------------------------------------*/
3077 /*-----------------------------------------------------------*/
3090 /*-----------------------------------------------------------*/
3096 Queue_t * pxQueueSetContainer = pxQueue->pxQueueSetContainer; in prvNotifyQueueSetContainer()
3102 * to prvNotifyQueueSetContainer is preceded by a check that in prvNotifyQueueSetContainer()
3105 configASSERT( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength ); in prvNotifyQueueSetContainer()
3107 if( pxQueueSetContainer->uxMessagesWaiting < pxQueueSetContainer->uxLength ) in prvNotifyQueueSetContainer()
3109 const int8_t cTxLock = pxQueueSetContainer->cTxLock; in prvNotifyQueueSetContainer()
3118 … if( listLIST_IS_EMPTY( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) == pdFALSE ) in prvNotifyQueueSetContainer()
3120 … if( xTaskRemoveFromEventList( &( pxQueueSetContainer->xTasksWaitingToReceive ) ) != pdFALSE ) in prvNotifyQueueSetContainer()