Home
last modified time | relevance | path

Searched full:buffer (Results 1 – 25 of 1730) sorted by relevance

12345678910>>...70

/Zephyr-Core-3.4.0/lib/os/
Dmpsc_pbuf.c10 #define MPSC_PBUF_DBG(buffer, ...) do { \ argument
13 if (buffer) { \
14 mpsc_state_print(buffer); \
19 static inline void mpsc_state_print(struct mpsc_pbuf_buffer *buffer) in mpsc_state_print() argument
23 buffer->wr_idx, buffer->tmp_wr_idx, in mpsc_state_print()
24 buffer->rd_idx, buffer->tmp_rd_idx); in mpsc_state_print()
28 void mpsc_pbuf_init(struct mpsc_pbuf_buffer *buffer, in mpsc_pbuf_init() argument
33 memset(buffer, 0, offsetof(struct mpsc_pbuf_buffer, buf)); in mpsc_pbuf_init()
34 buffer->get_wlen = cfg->get_wlen; in mpsc_pbuf_init()
35 buffer->notify_drop = cfg->notify_drop; in mpsc_pbuf_init()
[all …]
/Zephyr-Core-3.4.0/include/zephyr/sys/
Dmpsc_pbuf.h20 * @brief Multi producer, single consumer packet buffer API
21 * @defgroup mpsc_buf MPSC (Multi producer, single consumer) packet buffer API
27 * Multi producer, single consumer packet buffer allows to allocate variable
33 * If buffer is full and packet cannot be allocated then null is returned unless
40 * returns pointer to the packet within the buffer. Packet is freed when no
44 /**@defgroup MPSC_PBUF_FLAGS MPSC packet buffer flags
48 /** @brief Flag indicating that buffer size is power of 2.
50 * When buffer size is power of 2 then optimizations are applied.
54 /** @brief Flag indicating buffer full policy.
56 * If flag is set then when allocating from a full buffer oldest packets are
[all …]
Dring_buffer.h1 /* ring_buffer.h: Simple ring buffer API */
30 * @brief A structure to represent a ring buffer
33 uint8_t *buffer; member
55 * @defgroup ring_buffer_apis Ring Buffer APIs
61 * @brief Define and initialize a ring buffer for byte data.
63 * This macro establishes a ring buffer of an arbitrary size.
66 * The ring buffer can be accessed outside the module where it is defined
71 * @param name Name of the ring buffer.
72 * @param size8 Size of ring buffer (in bytes).
79 .buffer = _ring_buffer_data_##name, \
[all …]
Dspsc_pbuf.h18 * @brief Single producer, single consumer packet buffer API
23 /**@defgroup SPSC_PBUF_FLAGS MPSC packet buffer flags
54 /** @brief First part of packet buffer control block.
71 /** @brief Remaining part of a packet buffer when cache is used.
79 uint8_t data[]; /* Buffer data. */
82 /** @brief Remaining part of a packet buffer when cache is not used. */
85 uint8_t data[]; /* Buffer data. */
89 * @brief Single producer, single consumer packet buffer
91 * The SPSC packet buffer implements lightweight unidirectional packet buffer
96 * This structure supports single writer and reader. Data stored in the buffer
[all …]
/Zephyr-Core-3.4.0/tests/lib/sprintf/src/
Dmain.c105 char buffer[400]; in ZTEST() local
123 sprintf(buffer, "%e", var.d); in ZTEST()
124 zassert_true((strcmp(buffer, "inf") == 0), in ZTEST()
125 "sprintf(inf) - incorrect output '%s'\n", buffer); in ZTEST()
127 sprintf(buffer, "%E", var.d); in ZTEST()
128 zassert_true((strcmp(buffer, "INF") == 0), in ZTEST()
129 "sprintf(INF) - incorrect output '%s'\n", buffer); in ZTEST()
131 sprintf(buffer, "%f", var.d); in ZTEST()
132 zassert_true((strcmp(buffer, "inf") == 0), in ZTEST()
133 "sprintf(inf) - incorrect output '%s'\n", buffer); in ZTEST()
[all …]
/Zephyr-Core-3.4.0/subsys/tracing/include/
Dtracing_buffer.h18 * @brief Initialize tracing buffer.
23 * @brief Tracing buffer is empty or not.
25 * @return true if the ring buffer is empty, or false if not.
30 * @brief Get free space in the tracing buffer.
32 * @return Tracing buffer free space (in bytes).
37 * @brief Get tracing buffer capacity (max size).
39 * @return Tracing buffer capacity (in bytes).
44 * @brief Try to allocate buffer in the tracing buffer.
47 * within the tracing buffer.
48 * @param size Requested buffer size (in bytes).
[all …]
/Zephyr-Core-3.4.0/include/zephyr/net/
Dbuf.h2 * @brief Buffer management.
24 * @brief Network buffer library
25 * @defgroup net_buf Network Buffer Library
30 /* Alignment needed for various parts of the buffer definition */
40 * @param _size Maximum data storage for the buffer.
59 * @param _size Maximum data storage for the buffer.
71 * @brief Simple network buffer representation.
80 * when the buffer only needs to be allocated on the stack or when the
81 * access to and lifetime of the buffer is well controlled and constrained.
84 /** Pointer to the start of data in the buffer. */
[all …]
/Zephyr-Core-3.4.0/tests/lib/mpsc_pbuf/src/
Dmain.c59 static void drop(const struct mpsc_pbuf_buffer *buffer, const union mpsc_pbuf_generic *item) in drop() argument
90 static void init(struct mpsc_pbuf_buffer *buffer, uint32_t wlen, bool overwrite) in init() argument
96 mpsc_pbuf_init(buffer, &cfg); in init()
116 struct mpsc_pbuf_buffer buffer; in item_put_no_overwrite() local
118 init(&buffer, 4 - !pow2, false); in item_put_no_overwrite()
120 int repeat = buffer.size*2; in item_put_no_overwrite()
127 mpsc_pbuf_put_word(&buffer, test_1word.item); in item_put_no_overwrite()
129 t = (union test_item *)mpsc_pbuf_claim(&buffer); in item_put_no_overwrite()
132 mpsc_pbuf_free(&buffer, &t->item); in item_put_no_overwrite()
136 zassert_is_null(mpsc_pbuf_claim(&buffer)); in item_put_no_overwrite()
[all …]
/Zephyr-Core-3.4.0/samples/boards/esp32/flash_encryption/src/
Dmain.c25 uint8_t buffer[32]; in main() local
36 buffer[k] = k; in main()
38 LOG_HEXDUMP_INF(buffer, sizeof(buffer), "WRITE BUFFER CONTENT"); in main()
44 flash_write(flash_device, address, &buffer, sizeof(buffer)); in main()
47 memset(buffer, 0, sizeof(buffer)); in main()
48 spi_flash_read(address, &buffer, sizeof(buffer)); in main()
49 LOG_HEXDUMP_INF(buffer, sizeof(buffer), "FLASH RAW DATA (Encrypted)"); in main()
52 memset(buffer, 0, sizeof(buffer)); in main()
53 flash_read(flash_device, address, &buffer, sizeof(buffer)); in main()
54 LOG_HEXDUMP_INF(buffer, sizeof(buffer), "FLASH DECRYPTED DATA"); in main()
/Zephyr-Core-3.4.0/doc/kernel/data_structures/
Dring_buffers.rst6 A :dfn:`ring buffer` is a circular buffer, whose contents are stored in
12 buffer of memory.
19 can be enqueued and dequeued from the ring buffer in
25 legal to mix these two modes on a single ring buffer instance. A ring
26 buffer initialized with a byte count must be used only with the
39 ring buffer is referenced by its memory address.
41 A ring buffer has the following key properties:
43 * A **data buffer** of bytes or 32-bit words. The data buffer contains the raw
44 bytes or 32-bit words that have been added to the ring buffer but not yet
47 * A **data buffer size**, measured in bytes or 32-byte words. This governs
[all …]
Dspsc_pbuf.rst3 Single Producer Single Consumer Packet Buffer
6 A :dfn:`Single Producer Single Consumer Packet Buffer (SPSC_PBUF)` is a circular
7 buffer, whose contents are stored in first-in-first-out order. Variable size
8 packets are stored in the buffer. Packet buffer works under assumption that there
14 Packets are added to the buffer using :c:func:`spsc_pbuf_write` which copies a
15 data into the buffer. If the buffer is full error is returned.
17 Packets are copied out of the buffer using :c:func:`spsc_pbuf_read`.
/Zephyr-Core-3.4.0/include/zephyr/bluetooth/
Dbuf.h2 * @brief Bluetooth data buffer API
60 /** Helper to include reserved HCI data in buffer calculations */
63 /** Helper to calculate needed buffer size for HCI ACL packets */
66 /** Helper to calculate needed buffer size for HCI Event packets. */
69 /** Helper to calculate needed buffer size for HCI Command packets. */
72 /** Helper to calculate needed buffer size for HCI ISO packets. */
95 /** Buffer count needed for HCI ACL, HCI ISO or Event RX buffers */
103 /** Allocate a buffer for incoming data
105 * This will set the buffer type so bt_buf_set_type() does not need to
108 * @param type Type of buffer. Only BT_BUF_EVT, BT_BUF_ACL_IN and BT_BUF_ISO_IN
[all …]
/Zephyr-Core-3.4.0/subsys/logging/backends/
DKconfig.rtt13 is transferred to up-buffer at once depending on available space and
16 in up-buffer for a message and message is transferred to host.
25 bool "Drop messages that do not fit in up-buffer."
27 If there is not enough space in up-buffer for a message, drop it.
29 Increase up-buffer size helps to reduce dropping of messages.
34 Waits until there is enough space in the up-buffer for a message.
37 bool "Overwrite messages if up-buffer full"
39 If there is not enough space in up-buffer for a message overwrite
49 int "Size of internal buffer for storing messages."
54 This option defines maximum message size transferable to up-buffer.
[all …]
/Zephyr-Core-3.4.0/drivers/misc/ft8xx/
Dft8xx_common.c23 uint8_t buffer[2]; in ft8xx_wr16() local
25 *(uint16_t *)buffer = sys_cpu_to_le16(data); in ft8xx_wr16()
26 err = ft8xx_drv_write(address, buffer, sizeof(buffer)); in ft8xx_wr16()
33 uint8_t buffer[4]; in ft8xx_wr32() local
35 *(uint32_t *)buffer = sys_cpu_to_le32(data); in ft8xx_wr32()
36 err = ft8xx_drv_write(address, buffer, sizeof(buffer)); in ft8xx_wr32()
54 uint8_t buffer[2] = {0}; in ft8xx_rd16() local
56 err = ft8xx_drv_read(address, buffer, sizeof(buffer)); in ft8xx_rd16()
59 return sys_le16_to_cpu(*(const uint16_t *)buffer); in ft8xx_rd16()
65 uint8_t buffer[4] = {0}; in ft8xx_rd32() local
[all …]
/Zephyr-Core-3.4.0/tests/drivers/entropy/api/src/
Dmain.c18 * -# Verify whether buffer overflow occurred or not.
19 * -# Verify whether buffer completely filled or not.
30 static uint8_t buffer[BUFFER_LENGTH] = {0}; variable
32 static uint8_t buffer[BUFFER_LENGTH] = {0}; variable
35 static int random_entropy(const struct device *dev, char *buffer, char num) in random_entropy() argument
40 (void)memset(buffer, num, BUFFER_LENGTH); in random_entropy()
43 * write the last byte of the buffer. If that last in random_entropy()
45 * outside the passed buffer, and that should never in random_entropy()
48 ret = entropy_get_entropy(dev, buffer, BUFFER_LENGTH - 1); in random_entropy()
53 if (buffer[BUFFER_LENGTH - 1] != num) { in random_entropy()
[all …]
/Zephyr-Core-3.4.0/subsys/bluetooth/controller/util/
Ddbuf.h8 * @brief Generic double buffer data structure header.
16 /* Last enqueued element. It will be used after buffer is swapped. */
18 /* Size in a bytes of a single element stored in double buffer. */
20 /* Pointer for actual buffer memory. Its size should be 2 times @p elem_size. */
25 * @brief Allocate element in double buffer.
28 * For consecutive calls it always returns the same pointer until buffer is swapped
31 * @param hdr Pointer to double buffer header.
44 * @param hdr Pointer to double buffer header.
54 * @brief Enqueue new element for buffer swap.
56 * @param hdr Pointer to double buffer header.
[all …]
Dmfifo.h14 * buffer yet to be committed, exists in a limbo state - until committed.
15 * It is only safe to write to a buffer while it is in limbo.
17 * Invariant: last-index refers to the buffer that is safe to write while in
18 * limbo-state. Outside limbo state, last-index refers one buffer ahead of what
21 * There are essentially two APIs, distinguished by the buffer-type:
37 * Contains one-more buffer than needed.
68 * @brief Non-destructive: Allocate buffer from the queue's tail, by index
71 * 1. Allocation: Buffer allocation from tail. May fail.
75 * however the buffer remains in a state of limbo until committed.
77 * un-committed allocations returns the same buffer index.
[all …]
/Zephyr-Core-3.4.0/modules/canopennode/
DCO_driver.c85 CO_CANrx_t *buffer; in canopen_rx_callback() local
92 buffer = &CANmodule->rx_array[i]; in canopen_rx_callback()
94 if (buffer->filter_id == -ENOSPC || buffer->pFunct == NULL) { in canopen_rx_callback()
98 if (((frame->id ^ buffer->ident) & buffer->mask) == 0U) { in canopen_rx_callback()
102 buffer->pFunct(buffer->object, &rxMsg); in canopen_rx_callback()
132 CO_CANtx_t *buffer; in canopen_tx_retry() local
141 buffer = &CANmodule->tx_array[i]; in canopen_tx_retry()
142 if (buffer->bufferFull) { in canopen_tx_retry()
143 frame.id = buffer->ident; in canopen_tx_retry()
144 frame.dlc = buffer->DLC; in canopen_tx_retry()
[all …]
/Zephyr-Core-3.4.0/subsys/testsuite/coverage/
Dcoverage.c39 * buff_write_u64 - Store 64 bit data on a buffer and return the size
42 static inline void buff_write_u64(void *buffer, size_t *off, uint64_t v) in buff_write_u64() argument
44 memcpy((uint8_t *)buffer + *off, (uint8_t *)&v, sizeof(v)); in buff_write_u64()
49 * buff_write_u32 - Store 32 bit data on a buffer and return the size
51 static inline void buff_write_u32(void *buffer, size_t *off, uint32_t v) in buff_write_u32() argument
53 memcpy((uint8_t *)buffer + *off, (uint8_t *)&v, sizeof(v)); in buff_write_u32()
109 * This buffer will now have info similar to a regular gcda
112 size_t populate_buffer(uint8_t *buffer, struct gcov_info *info) in populate_buffer() argument
122 buff_write_u32(buffer, in populate_buffer()
126 buff_write_u32(buffer, in populate_buffer()
[all …]
/Zephyr-Core-3.4.0/include/zephyr/drivers/
Dentropy.h39 uint8_t *buffer,
48 uint8_t *buffer,
57 * @brief Fills a buffer with entropy. Blocks if required in order to
61 * @param buffer Buffer to fill with entropy.
62 * @param length Buffer length.
67 uint8_t *buffer,
71 uint8_t *buffer, in z_impl_entropy_get_entropy() argument
79 return api->get_entropy(dev, buffer, length); in z_impl_entropy_get_entropy()
86 * @brief Fills a buffer with entropy in a non-blocking or busy-wait manner.
90 * @param buffer Buffer to fill with entropy.
[all …]
/Zephyr-Core-3.4.0/include/zephyr/ipc/
Dicmsg.h121 * @param[in] msg Pointer to a buffer containing data to send.
122 * @param[in] len Size of data in the @p msg buffer.
137 /** @brief Get an empty TX buffer to be sent using @ref icmsg_send_nocopy
139 * This function can be called to get an empty TX buffer so that the
140 * application can directly put its data into the sending buffer avoiding copy
144 * buffer with data and passing correct parameters to @ref
147 * The size parameter can be used to request a buffer with a certain size:
149 * buffer is allocated
151 * the buffer is not allocated.
152 * - if the requested size is '0' the buffer is allocated with the maximum
[all …]
/Zephyr-Core-3.4.0/tests/unit/base64/
Dmain.c68 unsigned char buffer[128]; in ZTEST() local
75 rc = base64_encode(buffer, sizeof(buffer), &len, src, 64); in ZTEST()
77 rc = memcmp(base64_test_enc, buffer, 88); in ZTEST()
83 rc = base64_decode(buffer, sizeof(buffer), &len, src, 88); in ZTEST()
85 rc = memcmp(base64_test_dec, buffer, 64); in ZTEST()
89 rc = base64_encode(buffer, sizeof(buffer), &len, src, 0); in ZTEST()
94 rc = base64_encode(buffer, sizeof(buffer), &len, src, slen); in ZTEST()
101 rc = base64_encode(buffer, sizeof(buffer), &len, src, slen); in ZTEST()
107 rc = base64_decode(buffer, sizeof(buffer), &len, src, 88); in ZTEST()
111 rc = base64_decode(buffer, sizeof(buffer), &len, src, 88); in ZTEST()
[all …]
/Zephyr-Core-3.4.0/arch/arm/core/aarch32/cortex_m/
Dfpu.c17 void z_arm_save_fp_context(struct fpu_ctx_full *buffer) in z_arm_save_fp_context() argument
20 __ASSERT_NO_MSG(buffer != NULL); in z_arm_save_fp_context()
29 :: "r" (buffer->caller_saved), "r" (buffer->callee_saved) : in z_arm_save_fp_context()
32 buffer->fpscr = __get_FPSCR(); in z_arm_save_fp_context()
33 buffer->ctx_saved = true; in z_arm_save_fp_context()
46 void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer) in z_arm_restore_fp_context() argument
49 if (buffer->ctx_saved) { in z_arm_restore_fp_context()
56 __set_FPSCR(buffer->fpscr); in z_arm_restore_fp_context()
61 :: "r" (buffer->caller_saved), "r" (buffer->callee_saved) : in z_arm_restore_fp_context()
/Zephyr-Core-3.4.0/subsys/mgmt/ec_host_cmd/
DKconfig25 int "Buffer size in bytes for TX buffer shared by all EC host commands"
31 Buffer size in bytes for TX buffer defined by the host command handler.
32 Some backend layers can define their own buffer, so the size can be zero to
37 int "Buffer size in bytes for RX buffer shared by all EC host commands"
43 Buffer size in bytes for TX buffer defined by the host command handler.
44 Some backend layers can define their own buffer, so the size can be zero to
69 The handler defines common tx buffer
75 The handler defines common rx buffer
/Zephyr-Core-3.4.0/doc/kernel/services/data_passing/
Dpipes.rst17 The pipe can be configured with a ring buffer which holds data that has been
18 sent but not yet received; alternatively, the pipe may have no ring buffer.
25 * A **size** that indicates the size of the pipe's ring buffer. Note that a
26 size of zero defines a pipe with no ring buffer.
34 completed later. Accepted data is either copied to the pipe's ring buffer
41 data is either copied from the pipe's ring buffer or directly from the
45 either on the entire pipe or on only its ring buffer. Flushing the entire pipe
46 is equivalent to reading all the information in the ring buffer **and** waiting
47 to be written into a giant temporary buffer which is then discarded. Flushing
48 the ring buffer is equivalent to reading **only** the data in the ring buffer
[all …]

12345678910>>...70