24#ifndef CHERIOT_NO_AMBIENT_MALLOC
33 (void)xTriggerLevelBytes;
37 queue_create(&timeout, MALLOC_CAPABILITY, &ret, 1, xBufferSizeBytes);
65 size_t xDataLengthBytes,
68 struct Timeout timeout = {0, waitTicks};
89 size_t xDataLengthBytes,
92 *pxHigherPriorityTaskWoken =
pdFALSE;
106 size_t xBufferLengthBytes,
109 struct Timeout timeout = {0, xTicksToWait};
111 &timeout, xStreamBuffer, pvRxData, xBufferLengthBytes);
130 size_t xBufferLengthBytes,
133 *pxHigherPriorityTaskWoken =
pdFALSE;
174 return xStreamBuffer->
queueSize - outItems;
183 deprecated(
"Trigger levels are not currently supported in the FreeRTOS "
184 "streams compatibility layer"))) static inline
BaseType_t
186 size_t xTriggerLevel)
221 struct Timeout timeout = {0, 0};
FreeRTOS queue compatibility APIs.
int32_t BaseType_t
FreeRTOS default signed integer type.
Ticks TickType_t
FreeRTOS type for durations expressed in ticks.
#define pdFALSE
FreeRTOS definition of false.
int __cheri_libcall queue_send_multiple(TimeoutArgument timeout, struct MessageQueue *handle, const void *src, size_t count)
Send multiple messages to the queue specified by handle.
int __cheri_libcall queue_destroy(AllocatorCapability heapCapability, struct MessageQueue *handle)
Destroys a queue.
int __cheri_libcall queue_create(TimeoutArgument timeout, AllocatorCapability heapCapability, struct MessageQueue **outQueue, size_t elementSize, size_t elementCount)
Allocates space for a queue using heapCapability and stores a handle to it via outQueue.
int __cheri_libcall queue_items_remaining(struct MessageQueue *handle, size_t *items)
Returns the number of items in the queue specified by handle via items.
int __cheri_libcall queue_reset(TimeoutArgument timeout, struct MessageQueue *queue)
Reset a queue to its initial state.
int __cheri_libcall queue_receive_multiple(TimeoutArgument timeout, struct MessageQueue *handle, void *dst, size_t count)
Receive multiple messages to the queue specified by handle.
static BaseType_t xStreamBufferSetTriggerLevel(StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel)
Updates the trigger level of the stream.
static size_t xStreamBufferReceive(StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait)
Receive up to xBufferLengthBytes bytes into pvRxData from the stream given by xStreamBuffer.
static size_t xStreamBufferSpacesAvailable(StreamBufferHandle_t xStreamBuffer)
Returns the amount of space available in a stream, in bytes.
static size_t xStreamBufferBytesAvailable(StreamBufferHandle_t xStreamBuffer)
Returns the amount of data in a stream, in bytes.
static void vStreamBufferDelete(StreamBufferHandle_t xStreamBuffer)
Destroy a queue.
static StreamBufferHandle_t xStreamBufferCreate(size_t xBufferSizeBytes, size_t xTriggerLevelBytes)
Create a stream buffer that can store xBufferSizeBytes bytes.
static BaseType_t xStreamBufferResetFromISR(StreamBufferHandle_t xStreamBuffer)
Reset a stream from an ISR.
static BaseType_t xStreamBufferIsFull(StreamBufferHandle_t xStreamBuffer)
Returns pdTRUE if the stream is full, pdFALSE otherwise.
static BaseType_t xStreamBufferReset(StreamBufferHandle_t xStreamBuffer)
Reset the stream, unless another thread is currently active using it.
struct MessageQueue * StreamBufferHandle_t
Stream handle.
static size_t xStreamBufferSend(StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t waitTicks)
Sends xDataLengthBytes of data from pvTxData to the stream xStreamBuffer.
static BaseType_t xStreamBufferIsEmpty(StreamBufferHandle_t xStreamBuffer)
Returns pdTRUE if the stream is empty, pdFALSE otherwise.
Structure representing a queue.
size_t queueSize
The size of the queue.
Structure representing a timeout.
static const Ticks UnlimitedTimeout
Value indicating an unbounded timeout for use with Timeout.