29#ifndef ZEPHYR_INCLUDE_RTIO_RTIO_H_
30#define ZEPHYR_INCLUDE_RTIO_RTIO_H_
84#ifdef CONFIG_RTIO_SUBMIT_SEM
88 struct k_sem *submit_sem;
93#ifdef CONFIG_RTIO_CONSUME_SEM
98 struct k_sem *consume_sem;
113#ifdef CONFIG_RTIO_SYS_MEM_BLOCKS
115 struct sys_mem_blocks *block_pool;
124#ifdef CONFIG_RTIO_CQE_CALLBACK
129 void *cqe_cb_user_data;
134#define Z_RTIO_DEFINE(name, _sqe_pool, _cqe_pool, _block_pool) \
135 IF_ENABLED(CONFIG_RTIO_SUBMIT_SEM, \
136 (static K_SEM_DEFINE(CONCAT(_submit_sem_, name), 0, K_SEM_MAX_LIMIT))) \
137 IF_ENABLED(CONFIG_RTIO_CONSUME_SEM, \
138 (static K_SEM_DEFINE(CONCAT(_consume_sem_, name), 0, K_SEM_MAX_LIMIT))) \
139 STRUCT_SECTION_ITERABLE(rtio, name) = { \
140 IF_ENABLED(CONFIG_RTIO_SUBMIT_SEM, (.submit_sem = &CONCAT(_submit_sem_, name),)) \
141 IF_ENABLED(CONFIG_RTIO_SUBMIT_SEM, (.submit_count = 0,)) \
142 IF_ENABLED(CONFIG_RTIO_CONSUME_SEM, (.consume_sem = &CONCAT(_consume_sem_, name),))\
143 .cq_count = ATOMIC_INIT(0), \
144 .xcqcnt = ATOMIC_INIT(0), \
145 .sqe_pool = _sqe_pool, \
146 .cqe_pool = _cqe_pool, \
147 IF_ENABLED(CONFIG_RTIO_SYS_MEM_BLOCKS, (.block_pool = _block_pool,)) \
148 .sq = MPSC_INIT((name.sq)), \
149 .cq = MPSC_INIT((name.cq)), \
150 IF_ENABLED(CONFIG_RTIO_CQE_CALLBACK, (.cqe_cb = NULL, .cqe_cb_user_data = NULL,)) \
161#define RTIO_DEFINE(name, sq_sz, cq_sz) \
162 Z_RTIO_SQE_POOL_DEFINE(CONCAT(name, _sqe_pool), sq_sz); \
163 Z_RTIO_CQE_POOL_DEFINE(CONCAT(name, _cqe_pool), cq_sz); \
164 Z_RTIO_DEFINE(name, &CONCAT(name, _sqe_pool), \
165 &CONCAT(name, _cqe_pool), NULL)
177#ifndef CONFIG_RTIO_SYS_MEM_BLOCKS
184 return BIT(
r->block_pool->info.blk_sz_shift);
195#if defined(CONFIG_RTIO_SYS_MEM_BLOCKS) || defined(__DOXYGEN__)
196static inline uint16_t __rtio_compute_mempool_block_index(
const struct rtio *
r,
const void *ptr)
199 struct sys_mem_blocks *mem_pool =
r->block_pool;
203 uint32_t buff_size = mem_pool->info.num_blocks * block_size;
205 if (addr < buff || addr >= buff + buff_size) {
208 return (addr - buff) / block_size;
214static inline int rtio_block_pool_alloc(
struct rtio *
r,
size_t min_sz,
217#ifndef CONFIG_RTIO_SYS_MEM_BLOCKS
231 if (block_size == 0) {
240 *buf_len = num_blks * block_size;
244 if (bytes <= block_size) {
249 }
while (bytes >= min_sz);
255static inline void rtio_block_pool_free(
struct rtio *
r,
void *buf,
uint32_t buf_len)
257#ifndef CONFIG_RTIO_SYS_MEM_BLOCKS
262 size_t num_blks = buf_len >>
r->block_pool->info.blk_sz_shift;
286#if CONFIG_RTIO_BLOCK_POOL_PLACEMENT_DTCM
287#define RTIO_BMEM Z_GENERIC_SECTION(".dtcm_bss") static
288#elif defined(CONFIG_RTIO_BLOCK_POOL_PLACEMENT_NOCACHE)
289#define RTIO_BMEM __nocache static
291#define RTIO_BMEM COND_CODE_1(CONFIG_USERSPACE, (K_APP_BMEM(rtio_partition) static), (static))
303#if CONFIG_RTIO_BLOCK_POOL_PLACEMENT_DTCM
304#define RTIO_DMEM Z_GENERIC_SECTION(".dtcm_data") static
305#elif defined(CONFIG_RTIO_BLOCK_POOL_PLACEMENT_NOCACHE)
306#define RTIO_DMEM __nocache_load static
308#define RTIO_DMEM COND_CODE_1(CONFIG_USERSPACE, (K_APP_DMEM(rtio_partition) static), (static))
313#define Z_RTIO_BLOCK_POOL_DEFINE(name, blk_sz, blk_cnt, blk_align) \
314 RTIO_BMEM uint8_t __aligned(WB_UP(blk_align)) \
315 CONCAT(_block_pool_, name)[(blk_cnt) * WB_UP(blk_sz)]; \
316 _SYS_MEM_BLOCKS_DEFINE_WITH_EXT_BUF(name, WB_UP(blk_sz), (blk_cnt), \
317 CONCAT(_block_pool_, name), RTIO_DMEM)
334#define RTIO_DEFINE_WITH_MEMPOOL(name, sq_sz, cq_sz, num_blks, blk_size, balign) \
335 Z_RTIO_SQE_POOL_DEFINE(name##_sqe_pool, sq_sz); \
336 Z_RTIO_CQE_POOL_DEFINE(name##_cqe_pool, cq_sz); \
337 Z_RTIO_BLOCK_POOL_DEFINE(name##_block_pool, blk_size, num_blks, balign); \
338 Z_RTIO_DEFINE(name, &name##_sqe_pool, &name##_cqe_pool, &name##_block_pool)
351 return r->sqe_pool->pool_free;
367 if (iodev_sqe ==
NULL) {
375 return &iodev_sqe->
sqe;
395 for (i = 0; i < n; i++) {
396 iodev_sqe = rtio_sqe_pool_alloc(
r->sqe_pool);
397 if (iodev_sqe ==
NULL) {
400 sqes[i] = &iodev_sqe->
sqe;
408 rtio_sqe_pool_free(
r->sqe_pool, iodev_sqe);
415 for (i = 0; i < n; i++) {
433 while (node !=
NULL) {
435 rtio_sqe_pool_free(
r->sqe_pool, iodev_sqe);
446 struct rtio_cqe *cqe = rtio_cqe_pool_alloc(
r->cqe_pool);
479#ifdef CONFIG_RTIO_CQE_CALLBACK
480 r->cqe_cb = callback;
481 r->cqe_cb_user_data = user_data;
486 ARG_UNUSED(callback);
487 ARG_UNUSED(user_data);
518#ifdef CONFIG_RTIO_CONSUME_SEM
551#ifdef CONFIG_RTIO_CONSUME_SEM
555 while (node ==
NULL) {
573 rtio_cqe_pool_free(
r->cqe_pool, cqe);
592 if ((cqe->
result < 0) && (res == 0)) {
597 }
while (cqe !=
NULL);
615static inline void z_impl_rtio_sqe_signal(
struct rtio_sqe *sqe)
634#ifdef CONFIG_RTIO_SYS_MEM_BLOCKS
636 struct rtio *
r = iodev_sqe->
r;
637 struct sys_mem_blocks *mem_pool =
r->block_pool;
638 unsigned int blk_index = 0;
639 unsigned int blk_count = 0;
642 blk_index = (iodev_sqe->
sqe.
rx.
buf - mem_pool->buffer) >>
643 mem_pool->info.blk_sz_shift;
644 blk_count = iodev_sqe->
sqe.
rx.
buf_len >> mem_pool->info.blk_sz_shift;
649 ARG_UNUSED(iodev_sqe);
673static inline int z_impl_rtio_cqe_get_mempool_buffer(
const struct rtio *
r,
struct rtio_cqe *cqe,
676#ifdef CONFIG_RTIO_SYS_MEM_BLOCKS
682 *buff_len = blk_count * blk_size;
685 *buff =
r->block_pool->buffer + blk_idx * blk_size;
687 __ASSERT_NO_MSG(*buff >=
r->block_pool->buffer);
688 __ASSERT_NO_MSG(*buff <
689 r->block_pool->buffer + blk_size *
r->block_pool->info.num_blocks);
700 ARG_UNUSED(buff_len);
708void rtio_executor_submit(
struct rtio *
r);
709void rtio_executor_ok(
struct rtio_iodev_sqe *iodev_sqe,
int result);
710void rtio_executor_err(
struct rtio_iodev_sqe *iodev_sqe,
int result);
724 rtio_executor_ok(iodev_sqe, result);
737 rtio_executor_err(iodev_sqe, result);
763#ifdef CONFIG_RTIO_CONSUME_SEM
766#ifdef CONFIG_RTIO_CQE_CALLBACK
767 if (
r->cqe_cb !=
NULL) {
768 r->cqe_cb(
r,
r->cqe_cb_user_data);
783#ifdef CONFIG_RTIO_SUBMIT_SEM
784 if (
r->submit_count > 0) {
786 if (
r->submit_count == 0) {
794#define __RTIO_MEMPOOL_GET_NUM_BLKS(num_bytes, blk_size) (((num_bytes) + (blk_size)-1) / (blk_size))
813#ifdef CONFIG_RTIO_SYS_MEM_BLOCKS
815 struct rtio *
r = iodev_sqe->
r;
826 int rc = rtio_block_pool_alloc(
r, min_buf_len, max_buf_len, buf, buf_len);
836 ARG_UNUSED(max_buf_len);
864static inline void z_impl_rtio_release_buffer(
struct rtio *
r,
void *buff,
uint32_t buff_len)
866#ifdef CONFIG_RTIO_SYS_MEM_BLOCKS
867 if (
r ==
NULL || buff ==
NULL ||
r->block_pool ==
NULL || buff_len == 0) {
871 rtio_block_pool_free(
r, buff, buff_len);
875 ARG_UNUSED(buff_len);
889#ifdef CONFIG_RTIO_SUBMIT_SEM
893#ifdef CONFIG_RTIO_CONSUME_SEM
897#ifdef CONFIG_RTIO_OP_DELAY
916#ifdef CONFIG_RTIO_SUBMIT_SEM
920#ifdef CONFIG_RTIO_CONSUME_SEM
924#ifdef CONFIG_RTIO_OP_DELAY
941static inline int z_impl_rtio_sqe_cancel(
struct rtio_sqe *sqe)
949 }
while (iodev_sqe !=
NULL);
970 struct rtio_sqe **handle,
size_t sqe_count);
972static inline int z_impl_rtio_sqe_copy_in_get_handles(
struct rtio *
r,
const struct rtio_sqe *sqes,
979 if (acquirable < sqe_count) {
983 for (
unsigned long i = 0; i < sqe_count; i++) {
985 __ASSERT_NO_MSG(sqe !=
NULL);
986 if (handle !=
NULL && i == 0) {
1035static inline int z_impl_rtio_cqe_copy_out(
struct rtio *
r,
1051 cqes[copied++] = *cqe;
1075#ifdef CONFIG_RTIO_SUBMIT_SEM
1076static inline int z_impl_rtio_submit(
struct rtio *
r,
uint32_t wait_count)
1081 if (wait_count > 0) {
1083 "expected rtio submit with wait count to be called from a thread");
1086 r->submit_count = wait_count;
1089 rtio_executor_submit(
r);
1091 if (wait_count > 0) {
1094 "semaphore was reset or timed out while waiting on completions!");
1101static inline int z_impl_rtio_submit(
struct rtio *
r,
uint32_t wait_count)
1107 uintptr_t cq_complete_count = cq_count + wait_count;
1108 bool wraps = cq_complete_count < cq_count;
1110 rtio_executor_submit(
r);
1153static inline struct rtio *z_impl_rtio_pool_acquire(
struct rtio_pool *pool)
1157 for (
size_t i = 0; i < pool->
pool_size; i++) {
1179static inline void z_impl_rtio_pool_release(
struct rtio_pool *pool,
struct rtio *
r)
1186 for (
size_t i = 0; i < pool->
pool_size; i++) {
1198#define Z_RTIO_POOL_NAME_N(n, name) \
1201#define Z_RTIO_POOL_DEFINE_N(n, name, sq_sz, cq_sz) \
1202 RTIO_DEFINE(Z_RTIO_POOL_NAME_N(n, name), sq_sz, cq_sz)
1204#define Z_RTIO_POOL_REF_N(n, name) \
1205 &Z_RTIO_POOL_NAME_N(n, name)
1217#define RTIO_POOL_DEFINE(name, pool_sz, sq_sz, cq_sz) \
1218 LISTIFY(pool_sz, Z_RTIO_POOL_DEFINE_N, (;), name, sq_sz, cq_sz); \
1219 static struct rtio *name##_contexts[] = { \
1220 LISTIFY(pool_sz, Z_RTIO_POOL_REF_N, (,), name) \
1222 ATOMIC_DEFINE(name##_used, pool_sz); \
1223 STRUCT_SECTION_ITERABLE(rtio_pool, name) = { \
1224 .pool_size = pool_sz, \
1225 .contexts = name##_contexts, \
1226 .used = name##_used, \
1239#include <zephyr/syscalls/rtio.h>
workaround assembler barfing for ST r
Definition asm-macro-32-bit-gnu.h:27
RTIO Completion Queue Events and Related Functions.
APIs and macros for the Zephyr device model.
long atomic_t
Atomic integer variable.
Definition atomic_types.h:31
static void atomic_clear_bit(atomic_t *target, int bit)
Atomically clear a bit.
Definition atomic.h:227
atomic_val_t atomic_get(const atomic_t *target)
Atomic get.
static bool atomic_test_and_set_bit(atomic_t *target, int bit)
Atomically set a bit and test it.
Definition atomic.h:181
atomic_val_t atomic_inc(atomic_t *target)
Atomic increment.
bool atomic_cas(atomic_t *target, atomic_val_t old_value, atomic_val_t new_value)
Atomic compare-and-set.
#define K_FOREVER
Generate infinite timeout delay.
Definition kernel.h:1712
#define K_NO_WAIT
Generate null timeout delay.
Definition kernel.h:1602
k_timepoint_t sys_timepoint_calc(k_timeout_t timeout)
Calculate a timepoint value.
static bool sys_timepoint_expired(k_timepoint_t timepoint)
Indicates if timepoint is expired.
Definition clock.h:388
#define K_TIMEOUT_EQ(a, b)
Compare timeouts for equality.
Definition clock.h:80
bool k_is_in_isr(void)
Determine if code is running at interrupt level.
int sys_mem_blocks_free_contiguous(sys_mem_blocks_t *mem_block, void *block, size_t count)
Free contiguous multiple memory blocks.
int sys_mem_blocks_alloc_contiguous(sys_mem_blocks_t *mem_block, size_t count, void **out_block)
Allocate a contiguous set of memory blocks.
static ALWAYS_INLINE void mpsc_push(struct mpsc *q, struct mpsc_node *n)
Push a node.
Definition mpsc_lockfree.h:126
static struct mpsc_node * mpsc_pop(struct mpsc *q)
Pop a node off of the list.
Definition mpsc_lockfree.h:145
#define RTIO_CQE_FLAG_MEMPOOL_GET_BLK_CNT(flags)
Get the block count of a mempool flags.
Definition cqe.h:70
#define RTIO_CQE_FLAG_MEMPOOL_GET_BLK_IDX(flags)
Get the block index of a mempool flags.
Definition cqe.h:62
#define RTIO_CQE_FLAG_MEMPOOL_BUFFER
The entry's buffer was allocated from the RTIO's mempool.
Definition cqe.h:46
#define RTIO_CQE_FLAG_PREP_MEMPOOL(blk_idx, blk_cnt)
Prepare CQE flags for a mempool read.
Definition cqe.h:79
#define RTIO_CQE_FLAG_GET(flags)
Get the flag bits of a CQE flags value.
Definition cqe.h:54
#define RTIO_OP_RX
An operation that receives (reads).
Definition sqe.h:145
#define RTIO_SQE_MEMPOOL_BUFFER
The buffer should be allocated by the RTIO mempool.
Definition sqe.h:106
#define RTIO_SQE_CANCELED
The SQE should not execute if possible.
Definition sqe.h:114
void rtio_pool_release(struct rtio_pool *pool, struct rtio *r)
Return an RTIO context to a pool.
static uint32_t rtio_sqe_acquirable(struct rtio *r)
Count of acquirable submission queue events.
Definition rtio.h:349
struct rtio * rtio_pool_acquire(struct rtio_pool *pool)
Obtain an RTIO context from a pool.
static size_t rtio_mempool_block_size(const struct rtio *r)
Get the mempool block size of the RTIO context.
Definition rtio.h:175
static void rtio_cqe_submit(struct rtio *r, int result, void *userdata, uint32_t flags)
Submit a completion queue event with a given result and userdata.
Definition rtio.h:751
void rtio_release_buffer(struct rtio *r, void *buff, uint32_t buff_len)
Release memory that was allocated by the RTIO's memory pool.
static int rtio_sqe_copy_in(struct rtio *r, const struct rtio_sqe *sqes, size_t sqe_count)
Copy an array of SQEs into the queue.
Definition rtio.h:1011
void(* rtio_cqe_callback_t)(struct rtio *r, void *user_data)
RTIO completion queue event callback.
Definition rtio.h:70
static void rtio_cqe_produce(struct rtio *r, struct rtio_cqe *cqe)
Produce a complete queue event if available.
Definition rtio.h:496
static uint32_t rtio_cqe_compute_flags(struct rtio_iodev_sqe *iodev_sqe)
Compute the CQE flags from the rtio_iodev_sqe entry.
Definition rtio.h:630
int rtio_sqe_copy_in_get_handles(struct rtio *r, const struct rtio_sqe *sqes, struct rtio_sqe **handle, size_t sqe_count)
Copy an array of SQEs into the queue and get resulting handles back.
struct k_mem_partition rtio_partition
The memory partition associated with all RTIO context information.
static struct rtio_sqe * rtio_sqe_acquire(struct rtio *r)
Acquire a single submission queue event if available.
Definition rtio.h:362
static void rtio_sqe_drop_all(struct rtio *r)
Drop all previously acquired sqe.
Definition rtio.h:428
int rtio_cqe_copy_out(struct rtio *r, struct rtio_cqe *cqes, size_t cqe_count, k_timeout_t timeout)
Copy an array of CQEs from the queue.
static int rtio_flush_completion_queue(struct rtio *r)
Flush completion queue.
Definition rtio.h:584
static void rtio_access_revoke(struct rtio *r, struct k_thread *t)
Revoke access to an RTIO context from a user thread.
Definition rtio.h:912
static void rtio_access_grant(struct rtio *r, struct k_thread *t)
Grant access to an RTIO context to a user thread.
Definition rtio.h:885
static void rtio_cqe_release(struct rtio *r, struct rtio_cqe *cqe)
Release consumed completion queue event.
Definition rtio.h:570
static int rtio_sqe_rx_buf(const struct rtio_iodev_sqe *iodev_sqe, uint32_t min_buf_len, uint32_t max_buf_len, uint8_t **buf, uint32_t *buf_len)
Get the buffer associate with the RX submission.
Definition rtio.h:808
static int rtio_set_cqe_callback(struct rtio *r, rtio_cqe_callback_t callback, void *user_data)
Set the completion queue event callback.
Definition rtio.h:475
static void rtio_iodev_sqe_err(struct rtio_iodev_sqe *iodev_sqe, int result)
Inform the executor of a submissions completion with error.
Definition rtio.h:735
int rtio_sqe_cancel(struct rtio_sqe *sqe)
Attempt to cancel an SQE.
static void rtio_iodev_sqe_ok(struct rtio_iodev_sqe *iodev_sqe, int result)
Inform the executor of a submission completion with success.
Definition rtio.h:722
static struct rtio_cqe * rtio_cqe_acquire(struct rtio *r)
Acquire a complete queue event if available.
Definition rtio.h:443
static struct rtio_cqe * rtio_cqe_consume(struct rtio *r)
Consume a single completion queue event if available.
Definition rtio.h:512
void rtio_sqe_signal(struct rtio_sqe *sqe)
Signal an AWAIT SQE.
static struct rtio_iodev_sqe * rtio_iodev_sqe_next(const struct rtio_iodev_sqe *iodev_sqe)
Get the next sqe in the chain or transaction.
Definition sqe.h:788
int rtio_cqe_get_mempool_buffer(const struct rtio *r, struct rtio_cqe *cqe, uint8_t **buff, uint32_t *buff_len)
Retrieve the mempool buffer that was allocated for the CQE.
static struct rtio_cqe * rtio_cqe_consume_block(struct rtio *r)
Wait for and consume a single completion queue event.
Definition rtio.h:546
static int rtio_sqe_acquire_array(struct rtio *r, size_t n, struct rtio_sqe **sqes)
Acquire a number of submission queue events if available.
Definition rtio.h:390
int rtio_submit(struct rtio *r, uint32_t wait_count)
Submit I/O requests to the underlying executor.
void k_sem_reset(struct k_sem *sem)
Resets a semaphore's count to zero.
void k_sem_give(struct k_sem *sem)
Give a semaphore.
int k_sem_take(struct k_sem *sem, k_timeout_t timeout)
Take a semaphore.
#define SYS_PORT_TRACING_FUNC_ENTER(type, func,...)
Tracing macro for the entry into a function that might or might not return a value.
Definition tracing_macros.h:257
#define SYS_PORT_TRACING_FUNC_EXIT(type, func,...)
Tracing macro for when a function ends its execution.
Definition tracing_macros.h:283
#define SYS_PORT_TRACING_FUNC(type, func,...)
Tracing macro for function calls which are not directly associated with a specific type of object.
Definition tracing_macros.h:244
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define CONTAINER_OF(ptr, type, field)
Get a pointer to a structure containing the element.
Definition util.h:281
#define DIV_ROUND_UP(n, d)
Divide and round up.
Definition util.h:348
#define EINVAL
Invalid argument.
Definition errno.h:61
#define ENOMEM
Not enough core.
Definition errno.h:51
#define ENOTSUP
Unsupported value.
Definition errno.h:115
void k_yield(void)
Yield the current thread.
static __attribute_const__ k_tid_t k_current_get(void)
Get thread ID of the current thread.
Definition kernel.h:859
void k_object_access_grant(const void *object, struct k_thread *thread)
Grant a thread access to a kernel object.
void k_object_access_revoke(const void *object, struct k_thread *thread)
Revoke a thread's access to a kernel object.
#define NULL
Definition iar_missing_defs.h:20
RTIO I/O Device and Related Functions.
flags
Definition parser.h:97
RTIO Submission Queue Events and Related Functions.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
#define UINT16_MAX
Definition stdint.h:28
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
void * memset(void *buf, int c, size_t n)
Memory Partition.
Definition mem_domain.h:55
Semaphore structure.
Definition kernel.h:3738
Thread Structure.
Definition thread.h:258
Kernel timeout type.
Definition clock.h:65
Kernel timepoint type.
Definition clock.h:291
Queue member.
Definition mpsc_lockfree.h:79
MPSC Queue.
Definition mpsc_lockfree.h:86
A completion queue event.
Definition cqe.h:90
void * userdata
Associated userdata with operation.
Definition cqe.h:96
uint32_t flags
Flags associated with the operation.
Definition cqe.h:97
int32_t result
Result from operation.
Definition cqe.h:95
IO device submission queue entry.
Definition sqe.h:403
struct rtio_sqe sqe
Submission this entry carries.
Definition sqe.h:404
struct rtio * r
RTIO context the submission belongs to.
Definition sqe.h:407
struct mpsc_node q
Link used to enqueue this entry.
Definition sqe.h:405
Pool of RTIO contexts to use with dynamically created threads.
Definition rtio.h:1132
struct rtio ** contexts
Array containing contexts of the pool.
Definition rtio.h:1137
atomic_t * used
Atomic bitmap to signal a member is used/unused.
Definition rtio.h:1140
size_t pool_size
Size of the pool.
Definition rtio.h:1134
A submission queue event.
Definition sqe.h:310
void * userdata
User provided data which is returned upon operation completion.
Definition sqe.h:328
uint8_t op
Op code.
Definition sqe.h:311
uint32_t buf_len
Length of buffer.
Definition sqe.h:335
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@330064006263143366064036221227125351044336131221 await
OP_AWAIT.
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@110162343014114265152332336213215220201374200140 rx
OP_RX.
uint16_t flags
Op Flags.
Definition sqe.h:315
const uint8_t * buf
Buffer to write from.
Definition sqe.h:336
rtio_callback_t callback
Function to run.
Definition sqe.h:353
An RTIO context containing what can be viewed as a pair of queues.
Definition rtio.h:83
struct rtio_cqe_pool * cqe_pool
Completion queue object pool with free list.
Definition rtio.h:111
struct mpsc sq
Submission queue.
Definition rtio.h:119
atomic_t cq_count
Total number of completions.
Definition rtio.h:102
struct rtio_sqe_pool * sqe_pool
Submission queue object pool with free list.
Definition rtio.h:108
atomic_t xcqcnt
Number of completions dropped because no CQE was available.
Definition rtio.h:105
struct mpsc cq
Completion queue.
Definition rtio.h:122
Header file for the Atomic operations API.
Iterable sections helpers.
static bool k_is_user_context(void)
Indicate whether the CPU is currently in user mode.
Definition syscall.h:120