6#ifndef ZEPHYR_INCLUDE_SYS_MPSC_PBUF_H_
7#define ZEPHYR_INCLUDE_SYS_MPSC_PBUF_H_
52#define MPSC_PBUF_SIZE_POW2 BIT(0)
59#define MPSC_PBUF_MODE_OVERWRITE BIT(1)
ZTEST_BMEM int timeout
Definition: main.c:31
void
Definition: eswifi_shell.c:15
static ZTEST_BMEM char buffer[8]
Test mailbox enhance capabilities.
Definition: test_mbox_api.c:566
void mpsc_pbuf_put_word_ext(struct mpsc_pbuf_buffer *buffer, union mpsc_pbuf_generic word, void *data)
Put a packet consisting of a word and a pointer.Function is optimized for storing packet consisting o...
void mpsc_pbuf_put_word(struct mpsc_pbuf_buffer *buffer, union mpsc_pbuf_generic word)
Put single word packet into a buffer.
void(* mpsc_pbuf_notify_drop)(struct mpsc_pbuf_buffer *buffer, union mpsc_pbuf_generic *packet)
Callback called when packet is dropped.
Definition: mpsc_pbuf.h:80
bool mpsc_pbuf_is_pending(struct mpsc_pbuf_buffer *buffer)
Check if there are any message pending.
void mpsc_pbuf_put_data(struct mpsc_pbuf_buffer *buffer, uint32_t *data, size_t wlen)
Put a packet into a buffer.
void mpsc_pbuf_free(struct mpsc_pbuf_buffer *buffer, union mpsc_pbuf_generic *packet)
Free a packet.
union mpsc_pbuf_generic * mpsc_pbuf_alloc(struct mpsc_pbuf_buffer *buffer, size_t wlen, k_timeout_t timeout)
Allocate a packet.
union mpsc_pbuf_generic * mpsc_pbuf_claim(struct mpsc_pbuf_buffer *buffer)
Claim the first pending packet.
void mpsc_pbuf_init(struct mpsc_pbuf_buffer *buffer, const struct mpsc_pbuf_buffer_config *config)
Initnialize a packet buffer.
uint32_t(* mpsc_pbuf_get_wlen)(union mpsc_pbuf_generic *packet)
Callback prototype for getting length of a packet.
Definition: mpsc_pbuf.h:72
void mpsc_pbuf_commit(struct mpsc_pbuf_buffer *buffer, union mpsc_pbuf_generic *packet)
Commit a packet.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
Kernel Spin Lock.
Definition: spinlock.h:29
Kernel timeout type.
Definition: sys_clock.h:65
MPSC packet buffer configuration.
Definition: mpsc_pbuf.h:119
uint32_t * buf
Definition: mpsc_pbuf.h:121
mpsc_pbuf_notify_drop notify_drop
Definition: mpsc_pbuf.h:127
mpsc_pbuf_get_wlen get_wlen
Definition: mpsc_pbuf.h:128
uint32_t flags
Definition: mpsc_pbuf.h:131
uint32_t size
Definition: mpsc_pbuf.h:124
MPSC packet buffer structure.
Definition: mpsc_pbuf.h:84
uint32_t flags
Definition: mpsc_pbuf.h:98
struct k_spinlock lock
Definition: mpsc_pbuf.h:101
uint32_t * buf
Definition: mpsc_pbuf.h:110
uint32_t wr_idx
Definition: mpsc_pbuf.h:89
uint32_t tmp_wr_idx
Definition: mpsc_pbuf.h:86
uint32_t size
Definition: mpsc_pbuf.h:113
mpsc_pbuf_notify_drop notify_drop
Definition: mpsc_pbuf.h:104
mpsc_pbuf_get_wlen get_wlen
Definition: mpsc_pbuf.h:107
struct k_sem sem
Definition: mpsc_pbuf.h:115
uint32_t tmp_rd_idx
Definition: mpsc_pbuf.h:92
uint32_t rd_idx
Definition: mpsc_pbuf.h:95
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
Generic packet header.
Definition: mpsc_packet.h:49