Lines Matching +full:read +full:- +full:size
4 * SPDX-License-Identifier: Apache-2.0
24 /** @brief Size of packet length field. */
58 uint32_t dcache_alignment; /* CPU data cache line size in bytes.
59 * Used for validation - TODO: To be
88 * buffer with read/write semantics on top of a memory region shared
93 * is encapsulated to a message (with length header). The read/write API is
100 struct pbuf_data data; /* Data used to read and write
112 * @param size Size of the memory.
115 #define PBUF_CFG_INIT(mem_addr, size, dcache_align) \ argument
122 .len = (uint32_t)((uint32_t)(size) - MAX(dcache_align, _PBUF_IDX_SIZE) - \
130 * It contains the read index, write index and padding.
142 * @param size Size of the memory.
143 * @param dcache_align Data cache line size.
145 #define PBUF_DEFINE(name, mem_addr, size, dcache_align) \ argument
147 "Cache line size must be non negative."); \
148 BUILD_ASSERT((size) > 0 && IS_PTR_ALIGNED_BYTES(size, _PBUF_IDX_SIZE), \
149 "Incorrect size."); \
152 BUILD_ASSERT(size >= (MAX(dcache_align, _PBUF_IDX_SIZE) + _PBUF_IDX_SIZE + \
153 _PBUF_MIN_DATA_LEN), "Insufficient size."); \
155 PBUF_CFG_INIT(mem_addr, size, dcache_align); \
172 * @retval -EINVAL when the input parameter is incorrect.
188 * @retval -EINVAL when the input parameter is incorrect.
202 * -EINVAL, if any of input parameter is incorrect.
203 * -ENOMEM, if len is bigger than the buffer can fit.
209 * @brief Read specified amount of data from the packet buffer.
211 * Single read allows to read the message send by the single write.
214 * @param pb A buffer from which data will be read.
215 * @param buf Data pointer to which read data will be written.
217 * @param len Number of bytes to be read from the buffer.
218 * @retval int Bytes read, negative error code on fail.
219 * Bytes to be read, if buf == NULL.
220 * -EINVAL, if any of input parameter is incorrect.
221 * -ENOMEM, if message can not fit in provided buf.
222 * -EAGAIN, if not whole message is ready yet.