Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sqe.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2022 Intel Corporation
3 * SPDX-FileCopyrightText: Copyright (c) 2026 Infineon Technologies AG,
4 * SPDX-FileCopyrightText: or an affiliate of Infineon Technologies AG. All rights reserved.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
14
15
16#ifndef ZEPHYR_INCLUDE_RTIO_SQE_H_
17#define ZEPHYR_INCLUDE_RTIO_SQE_H_
18
19#include <stdint.h>
20#include <string.h>
21#include <zephyr/kernel.h>
22#include <zephyr/sys/atomic.h>
24#include <zephyr/sys/util.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
34
47
51#define RTIO_PRIO_LOW 0U
52
56#define RTIO_PRIO_NORM 127U
57
61#define RTIO_PRIO_HIGH 255U
62
66
67
74
82#define RTIO_SQE_CHAINED BIT(0)
83
94#define RTIO_SQE_TRANSACTION BIT(1)
95
96
106#define RTIO_SQE_MEMPOOL_BUFFER BIT(2)
107
114#define RTIO_SQE_CANCELED BIT(3)
115
122#define RTIO_SQE_MULTISHOT BIT(4)
123
127#define RTIO_SQE_NO_RESPONSE BIT(5)
128
132
133
140
142#define RTIO_OP_NOP 0
143
145#define RTIO_OP_RX (RTIO_OP_NOP+1)
146
148#define RTIO_OP_TX (RTIO_OP_RX+1)
149
151#define RTIO_OP_TINY_TX (RTIO_OP_TX+1)
152
154#define RTIO_OP_CALLBACK (RTIO_OP_TINY_TX+1)
155
157#define RTIO_OP_TXRX (RTIO_OP_CALLBACK+1)
158
160#define RTIO_OP_DELAY (RTIO_OP_TXRX+1)
161
163#define RTIO_OP_I2C_RECOVER (RTIO_OP_DELAY+1)
164
166#define RTIO_OP_I2C_CONFIGURE (RTIO_OP_I2C_RECOVER+1)
167
169#define RTIO_OP_I3C_RECOVER (RTIO_OP_I2C_CONFIGURE+1)
170
172#define RTIO_OP_I3C_CONFIGURE (RTIO_OP_I3C_RECOVER+1)
173
175#define RTIO_OP_I3C_CCC (RTIO_OP_I3C_CONFIGURE+1)
176
178#define RTIO_OP_AWAIT (RTIO_OP_I3C_CCC+1)
179
183
184
191
195#define RTIO_IODEV_I2C_STOP BIT(1)
196
200#define RTIO_IODEV_I2C_RESTART BIT(2)
201
205#define RTIO_IODEV_I2C_10_BITS BIT(3)
206
210
217
221#define RTIO_IODEV_I3C_STOP BIT(1)
222
226#define RTIO_IODEV_I3C_RESTART BIT(2)
227
231#define RTIO_IODEV_I3C_HDR BIT(3)
232
236#define RTIO_IODEV_I3C_NBCH BIT(4)
237
241#define RTIO_IODEV_I3C_NOACK_EXPECTED BIT(5)
242
246#define RTIO_IODEV_I3C_HDR_MODE_MASK GENMASK(15, 8)
247
251#define RTIO_IODEV_I3C_HDR_MODE_SET(flags) \
252 FIELD_PREP(RTIO_IODEV_I3C_HDR_MODE_MASK, flags)
253
257#define RTIO_IODEV_I3C_HDR_MODE_GET(flags) \
258 FIELD_GET(RTIO_IODEV_I3C_HDR_MODE_MASK, flags)
259
263#define RTIO_IODEV_I3C_HDR_CMD_CODE_MASK GENMASK(22, 16)
264
268#define RTIO_IODEV_I3C_HDR_CMD_CODE_SET(flags) \
269 FIELD_PREP(RTIO_IODEV_I3C_HDR_CMD_CODE_MASK, flags)
270
274#define RTIO_IODEV_I3C_HDR_CMD_CODE_GET(flags) \
275 FIELD_GET(RTIO_IODEV_I3C_HDR_CMD_CODE_MASK, flags)
276
280
281
283struct rtio_sqe;
284struct rtio_iodev_sqe;
285struct rtio_iodev;
286struct rtio;
288
297typedef void (*rtio_callback_t)(struct rtio *r, const struct rtio_sqe *sqe, int res, void *arg0);
298
305typedef void (*rtio_signaled_t)(struct rtio_iodev_sqe *iodev_sqe, void *userdata);
306
310struct rtio_sqe {
312
314
316
318
319 const struct rtio_iodev *iodev;
320
328 void *userdata;
329
331 union {
332
334 struct {
336 const uint8_t *buf;
337 } tx;
338
340 struct {
341 uint32_t buf_len;
343 } rx;
344
346 struct {
349 } tiny_tx;
350
352 struct {
354 void *arg0;
355 } callback;
356
358 struct {
359 uint32_t buf_len;
362 } txrx;
363
364#ifdef CONFIG_RTIO_OP_DELAY
366 struct {
367 k_timeout_t timeout;
368 k_timepoint_t expiry;
369 } delay;
370#endif
371
374
376 struct {
377 /* enum i3c_config_type type; */
378 int type;
379 void *config;
380 } i3c_config;
381
383 /* struct i3c_ccc_payload *ccc_payload; */
385
387 struct {
389 atomic_t ok;
392 void *userdata;
393 } await;
394 };
395};
396
397
404 struct rtio_sqe sqe;
405 struct mpsc_node q;
407 struct rtio *r;
408};
409
410
412/* Ensure the rtio_iodev_sqe never grows beyond a common cacheline size of 64 bytes */
413#if CONFIG_RTIO_SQE_CACHELINE_CHECK
414#ifdef CONFIG_DCACHE_LINE_SIZE
415#define RTIO_CACHE_LINE_SIZE CONFIG_DCACHE_LINE_SIZE
416#else
417#define RTIO_CACHE_LINE_SIZE 64
418#endif
419BUILD_ASSERT(sizeof(struct rtio_iodev_sqe) <= RTIO_CACHE_LINE_SIZE,
420 "RTIO performs best when the submissions queue entries are less than a cache line");
421#endif
423
427static inline void rtio_sqe_prep_nop(struct rtio_sqe *sqe,
428 const struct rtio_iodev *iodev,
429 void *userdata)
430{
431 memset(sqe, 0, sizeof(struct rtio_sqe));
432 sqe->op = RTIO_OP_NOP;
433 sqe->iodev = iodev;
434 sqe->userdata = userdata;
435}
436
437
442static inline void _rtio_sqe_prep_read(struct rtio_sqe *sqe,
443 const struct rtio_iodev *iodev,
444 int8_t prio,
445 uint8_t *buf,
446 uint32_t len,
447 void *userdata)
448{
449 memset(sqe, 0, sizeof(struct rtio_sqe));
450 sqe->op = RTIO_OP_RX;
451 sqe->prio = prio;
452 sqe->iodev = iodev;
453 sqe->rx.buf_len = len;
454 sqe->rx.buf = buf;
455 sqe->userdata = userdata;
456}
458
462static inline void rtio_sqe_prep_read(struct rtio_sqe *sqe,
463 const struct rtio_iodev *iodev,
464 int8_t prio,
465 uint8_t *buf,
466 uint32_t len,
467 void *userdata)
468{
469 __ASSERT_NO_MSG(len > 0 && buf != NULL);
470
471 _rtio_sqe_prep_read(sqe, iodev, prio, buf, len, userdata);
472}
473
479static inline void rtio_sqe_prep_read_with_pool(struct rtio_sqe *sqe,
480 const struct rtio_iodev *iodev, int8_t prio,
481 void *userdata)
482{
483 _rtio_sqe_prep_read(sqe, iodev, prio, NULL, 0, userdata);
485}
486
494static inline void rtio_sqe_prep_read_multishot(struct rtio_sqe *sqe,
495 const struct rtio_iodev *iodev, int8_t prio,
496 void *userdata)
497{
498 rtio_sqe_prep_read_with_pool(sqe, iodev, prio, userdata);
500}
501
505static inline void rtio_sqe_prep_write(struct rtio_sqe *sqe,
506 const struct rtio_iodev *iodev,
507 int8_t prio,
508 const uint8_t *buf,
509 uint32_t len,
510 void *userdata)
511{
512 __ASSERT_NO_MSG(len > 0 && buf != NULL);
513
514 memset(sqe, 0, sizeof(struct rtio_sqe));
515 sqe->op = RTIO_OP_TX;
516 sqe->prio = prio;
517 sqe->iodev = iodev;
518 sqe->tx.buf_len = len;
519 sqe->tx.buf = buf;
520 sqe->userdata = userdata;
521}
522
533static inline void rtio_sqe_prep_tiny_write(struct rtio_sqe *sqe,
534 const struct rtio_iodev *iodev,
535 int8_t prio,
536 const uint8_t *tiny_write_data,
537 uint8_t tiny_write_len,
538 void *userdata)
539{
540 __ASSERT_NO_MSG(tiny_write_len <= sizeof(sqe->tiny_tx.buf));
541 __ASSERT_NO_MSG(tiny_write_len > 0 && tiny_write_data != NULL);
542
543 memset(sqe, 0, sizeof(struct rtio_sqe));
544 sqe->op = RTIO_OP_TINY_TX;
545 sqe->prio = prio;
546 sqe->iodev = iodev;
547 sqe->tiny_tx.buf_len = tiny_write_len;
548 memcpy(sqe->tiny_tx.buf, tiny_write_data, tiny_write_len);
549 sqe->userdata = userdata;
550}
551
560static inline void rtio_sqe_prep_callback(struct rtio_sqe *sqe,
561 rtio_callback_t callback,
562 void *arg0,
563 void *userdata)
564{
565 memset(sqe, 0, sizeof(struct rtio_sqe));
566 sqe->op = RTIO_OP_CALLBACK;
567 sqe->prio = 0;
568 sqe->iodev = NULL;
569 sqe->callback.callback = callback;
570 sqe->callback.arg0 = arg0;
571 sqe->userdata = userdata;
572}
573
584static inline void rtio_sqe_prep_callback_no_cqe(struct rtio_sqe *sqe,
585 rtio_callback_t callback,
586 void *arg0,
587 void *userdata)
588{
589 rtio_sqe_prep_callback(sqe, callback, arg0, userdata);
591}
592
596static inline void rtio_sqe_prep_transceive(struct rtio_sqe *sqe,
597 const struct rtio_iodev *iodev,
598 int8_t prio,
599 const uint8_t *tx_buf,
600 uint8_t *rx_buf,
601 uint32_t buf_len,
602 void *userdata)
603{
604 __ASSERT_NO_MSG(buf_len > 0 && tx_buf != NULL && rx_buf != NULL);
605
606 memset(sqe, 0, sizeof(struct rtio_sqe));
607 sqe->op = RTIO_OP_TXRX;
608 sqe->prio = prio;
609 sqe->iodev = iodev;
610 sqe->txrx.buf_len = buf_len;
611 sqe->txrx.tx_buf = tx_buf;
612 sqe->txrx.rx_buf = rx_buf;
613 sqe->userdata = userdata;
614}
615
630static inline void rtio_sqe_prep_await(struct rtio_sqe *sqe,
631 const struct rtio_iodev *iodev,
632 int8_t prio,
633 void *userdata)
634{
635 memset(sqe, 0, sizeof(struct rtio_sqe));
636 sqe->op = RTIO_OP_AWAIT;
637 sqe->prio = prio;
638 sqe->iodev = iodev;
639 sqe->userdata = userdata;
640}
641
653static inline void rtio_sqe_prep_await_iodev(struct rtio_sqe *sqe, const struct rtio_iodev *iodev,
654 int8_t prio, void *userdata)
655{
656 __ASSERT_NO_MSG(iodev != NULL);
657 rtio_sqe_prep_await(sqe, iodev, prio, userdata);
658}
659
670static inline void rtio_sqe_prep_await_executor(struct rtio_sqe *sqe, int8_t prio, void *userdata)
671{
672 rtio_sqe_prep_await(sqe, NULL, prio, userdata);
673}
674
686#ifdef CONFIG_RTIO_OP_DELAY
693extern struct rtio_iodev rtio_timeout_iodev;
694
695static inline void rtio_sqe_prep_delay(struct rtio_sqe *sqe,
696 k_timeout_t timeout,
697 void *userdata)
698{
699 memset(sqe, 0, sizeof(struct rtio_sqe));
700 sqe->op = RTIO_OP_DELAY;
701 sqe->prio = 0;
702 sqe->iodev = &rtio_timeout_iodev;
703 sqe->delay.timeout = timeout;
704 sqe->userdata = userdata;
705}
706#else
707#define rtio_sqe_prep_delay(sqe, timeout, userdata) \
708 BUILD_ASSERT(false, "CONFIG_RTIO_OP_DELAY not enabled")
709#endif
710
712static inline void rtio_sqe_prep_i2c_configure(struct rtio_sqe *sqe,
713 const struct rtio_iodev *iodev,
714 int8_t prio,
715 uint32_t dev_config,
716 void *userdata)
717{
718 memset(sqe, 0, sizeof(struct rtio_sqe));
720 sqe->prio = prio;
721 sqe->iodev = iodev;
722 sqe->i2c_config = dev_config;
723 sqe->userdata = userdata;
724}
725
727static inline void rtio_sqe_prep_i2c_recover(struct rtio_sqe *sqe,
728 const struct rtio_iodev *iodev,
729 int8_t prio,
730 void *userdata)
731{
732 memset(sqe, 0, sizeof(struct rtio_sqe));
733 sqe->op = RTIO_OP_I2C_RECOVER;
734 sqe->prio = prio;
735 sqe->iodev = iodev;
736 sqe->userdata = userdata;
737}
738
747static inline struct rtio_iodev_sqe *rtio_txn_next(const struct rtio_iodev_sqe *iodev_sqe)
748{
749 struct rtio_iodev_sqe *next = NULL;
750
751 SYS_PORT_TRACING_FUNC_ENTER(rtio, txn_next, iodev_sqe->r, iodev_sqe);
752 if (iodev_sqe->sqe.flags & RTIO_SQE_TRANSACTION) {
753 next = iodev_sqe->next;
754 }
755 SYS_PORT_TRACING_FUNC_EXIT(rtio, txn_next, iodev_sqe->r, next);
756 return next;
757}
758
759
768static inline struct rtio_iodev_sqe *rtio_chain_next(const struct rtio_iodev_sqe *iodev_sqe)
769{
770 struct rtio_iodev_sqe *next = NULL;
771
772 SYS_PORT_TRACING_FUNC_ENTER(rtio, txn_next, iodev_sqe->r, iodev_sqe);
773 if (iodev_sqe->sqe.flags & RTIO_SQE_CHAINED) {
774 next = iodev_sqe->next;
775 }
776 SYS_PORT_TRACING_FUNC_EXIT(rtio, txn_next, iodev_sqe->r, next);
777 return next;
778}
779
788static inline struct rtio_iodev_sqe *rtio_iodev_sqe_next(const struct rtio_iodev_sqe *iodev_sqe)
789{
790 return iodev_sqe->next;
791}
792
803static inline void rtio_iodev_sqe_await_signal(struct rtio_iodev_sqe *iodev_sqe,
804 rtio_signaled_t callback,
805 void *userdata)
806{
807 iodev_sqe->sqe.await.callback = callback;
808 iodev_sqe->sqe.await.userdata = userdata;
809
810 if (!atomic_cas(&iodev_sqe->sqe.await.ok, 0, 1)) {
811 callback(iodev_sqe, userdata);
812 }
813}
814
815/* Private structures and functions used for the pool of sqe structures */
817
818struct rtio_sqe_pool {
819 struct mpsc free_q;
820 const uint16_t pool_size;
821 uint16_t pool_free;
822 struct rtio_iodev_sqe *pool;
823};
824
825static inline struct rtio_iodev_sqe *rtio_sqe_pool_alloc(struct rtio_sqe_pool *pool)
826{
827 struct mpsc_node *node = mpsc_pop(&pool->free_q);
828
829 if (node == NULL) {
830 return NULL;
831 }
832
833 struct rtio_iodev_sqe *iodev_sqe = CONTAINER_OF(node, struct rtio_iodev_sqe, q);
834
835 pool->pool_free--;
836
837 return iodev_sqe;
838}
839
840static inline void rtio_sqe_pool_free(struct rtio_sqe_pool *pool, struct rtio_iodev_sqe *iodev_sqe)
841{
842 mpsc_push(&pool->free_q, &iodev_sqe->q);
843
844 pool->pool_free++;
845}
846
847#if CONFIG_RTIO_SQE_PLACEMENT_DTCM
848#define RTIO_SQE_MEM Z_GENERIC_SECTION(".dtcm_bss") static
849#elif defined(CONFIG_RTIO_SQE_PLACEMENT_NOCACHE)
850#define RTIO_SQE_MEM __nocache static
851#else
852#define RTIO_SQE_MEM static
853#endif
854
855/* Do not try and reformat the macros */
856/* clang-format off */
857
858#define Z_RTIO_SQE_POOL_DEFINE(name, sz) \
859 RTIO_SQE_MEM struct rtio_iodev_sqe CONCAT(_sqe_pool_, name)[sz]; \
860 STRUCT_SECTION_ITERABLE(rtio_sqe_pool, name) = { \
861 .free_q = MPSC_INIT((name.free_q)), \
862 .pool_size = sz, \
863 .pool_free = sz, \
864 .pool = CONCAT(_sqe_pool_, name), \
865 }
866
867/* clang-format on */
869
873
874#ifdef __cplusplus
875}
876#endif
877
878#endif /* ZEPHYR_INCLUDE_RTIO_SQE_H_ */
workaround assembler barfing for ST r
Definition asm-macro-32-bit-gnu.h:27
long atomic_t
Atomic integer variable.
Definition atomic_types.h:31
bool atomic_cas(atomic_t *target, atomic_val_t old_value, atomic_val_t new_value)
Atomic compare-and-set.
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_OP_CALLBACK
An operation that calls a given function (callback).
Definition sqe.h:154
#define RTIO_OP_I2C_RECOVER
An operation to recover I2C buses.
Definition sqe.h:163
#define RTIO_OP_TINY_TX
An operation that transmits tiny writes by copying the data to write.
Definition sqe.h:151
#define RTIO_OP_TX
An operation that transmits (writes).
Definition sqe.h:148
#define RTIO_OP_TXRX
An operation that transceives (reads and writes simultaneously).
Definition sqe.h:157
#define RTIO_OP_NOP
An operation that does nothing and will complete immediately.
Definition sqe.h:142
#define RTIO_OP_AWAIT
An operation to await a signal while blocking the iodev (if one is provided).
Definition sqe.h:178
#define RTIO_OP_I2C_CONFIGURE
An operation to configure I2C buses.
Definition sqe.h:166
#define RTIO_OP_DELAY
An operation that takes a specified amount of time (asynchronously) before completing.
Definition sqe.h:160
#define RTIO_OP_RX
An operation that receives (reads).
Definition sqe.h:145
#define RTIO_SQE_MULTISHOT
The SQE should continue producing CQEs until canceled.
Definition sqe.h:122
#define RTIO_SQE_TRANSACTION
The next request in the queue is part of a transaction.
Definition sqe.h:94
#define RTIO_SQE_MEMPOOL_BUFFER
The buffer should be allocated by the RTIO mempool.
Definition sqe.h:106
#define RTIO_SQE_NO_RESPONSE
The SQE does not produce a CQE.
Definition sqe.h:127
#define RTIO_SQE_CHAINED
The next request in the queue should wait on this one.
Definition sqe.h:82
static void rtio_sqe_prep_read_with_pool(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, void *userdata)
Prepare a read op submission with context's mempool.
Definition sqe.h:479
static void rtio_sqe_prep_i2c_recover(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, void *userdata)
Prepare an i2c recover op submission.
Definition sqe.h:727
static void rtio_sqe_prep_tiny_write(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, const uint8_t *tiny_write_data, uint8_t tiny_write_len, void *userdata)
Prepare a tiny write op submission.
Definition sqe.h:533
static void rtio_sqe_prep_nop(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, void *userdata)
Prepare a nop (no op) submission.
Definition sqe.h:427
void(* rtio_callback_t)(struct rtio *r, const struct rtio_sqe *sqe, int res, void *arg0)
Callback signature for RTIO_OP_CALLBACK.
Definition sqe.h:297
static void rtio_sqe_prep_await_iodev(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, void *userdata)
Prepare an await op submission which blocks an rtio_iodev until completion.
Definition sqe.h:653
static void rtio_iodev_sqe_await_signal(struct rtio_iodev_sqe *iodev_sqe, rtio_signaled_t callback, void *userdata)
Await an AWAIT SQE signal from RTIO IODEV.
Definition sqe.h:803
static void rtio_sqe_prep_write(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, const uint8_t *buf, uint32_t len, void *userdata)
Prepare a write op submission.
Definition sqe.h:505
static void rtio_sqe_prep_read(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, uint8_t *buf, uint32_t len, void *userdata)
Prepare a read op submission.
Definition sqe.h:462
static void rtio_sqe_prep_read_multishot(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, void *userdata)
Prepare a multishot read op submission with context's mempool.
Definition sqe.h:494
static void rtio_sqe_prep_callback(struct rtio_sqe *sqe, rtio_callback_t callback, void *arg0, void *userdata)
Prepare a callback op submission.
Definition sqe.h:560
static void rtio_sqe_prep_await_executor(struct rtio_sqe *sqe, int8_t prio, void *userdata)
Prepare an await op submission which completes the sqe after being signaled.
Definition sqe.h:670
void(* rtio_signaled_t)(struct rtio_iodev_sqe *iodev_sqe, void *userdata)
Callback signature for RTIO_OP_AWAIT signaled.
Definition sqe.h:305
static void rtio_sqe_prep_transceive(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, const uint8_t *tx_buf, uint8_t *rx_buf, uint32_t buf_len, void *userdata)
Prepare a transceive op submission.
Definition sqe.h:596
static void rtio_sqe_prep_i2c_configure(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, uint32_t dev_config, void *userdata)
Prepare an i2c configure op submission.
Definition sqe.h:712
#define rtio_sqe_prep_delay(sqe, timeout, userdata)
Prepare a delay operation submission which completes after the given timeout.
Definition sqe.h:707
static struct rtio_iodev_sqe * rtio_chain_next(const struct rtio_iodev_sqe *iodev_sqe)
Get the next sqe in the chain.
Definition sqe.h:768
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
static void rtio_sqe_prep_callback_no_cqe(struct rtio_sqe *sqe, rtio_callback_t callback, void *arg0, void *userdata)
Prepare a callback op submission that does not create a CQE.
Definition sqe.h:584
static struct rtio_iodev_sqe * rtio_txn_next(const struct rtio_iodev_sqe *iodev_sqe)
Get the next sqe in the transaction.
Definition sqe.h:747
static void rtio_sqe_prep_await(struct rtio_sqe *sqe, const struct rtio_iodev *iodev, int8_t prio, void *userdata)
Prepare an await op submission.
Definition sqe.h:630
#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 CONTAINER_OF(ptr, type, field)
Get a pointer to a structure containing the element.
Definition util.h:281
#define NULL
Definition iar_missing_defs.h:20
#define BUILD_ASSERT(EXPR, MSG...)
Definition llvm.h:51
Public kernel APIs.
A wait-free intrusive multi producer single consumer (MPSC) queue using a singly linked list.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
void * memset(void *buf, int c, size_t n)
void * memcpy(void *ZRESTRICT d, const void *ZRESTRICT s, size_t n)
Kernel timeout type.
Definition clock.h:65
Kernel timepoint type.
Definition clock.h:291
Queue member.
Definition mpsc_lockfree.h:79
IO device submission queue entry.
Definition sqe.h:403
struct rtio_iodev_sqe * next
Next entry in the chain or transaction, NULL if last.
Definition sqe.h:406
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
An IO device with a function table for submitting requests.
Definition iodev.h:49
A submission queue event.
Definition sqe.h:310
uint32_t i2c_config
OP_I2C_CONFIGURE.
Definition sqe.h:373
void * userdata
User provided data which is returned upon operation completion.
Definition sqe.h:328
const uint8_t * tx_buf
Buffer to write from.
Definition sqe.h:360
uint8_t op
Op code.
Definition sqe.h:311
void * arg0
Last argument given to callback.
Definition sqe.h:354
uint8_t * rx_buf
Buffer to read into.
Definition sqe.h:361
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@017245174153135075241134370152236032302025336125 tiny_tx
OP_TINY_TX.
uint8_t prio
Op priority.
Definition sqe.h:313
uint32_t buf_len
Length of buffer.
Definition sqe.h:335
const struct rtio_iodev * iodev
Device to operation on.
Definition sqe.h:319
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@331301263323312231326352370225016114352302103127 txrx
OP_TXRX.
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@330064006263143366064036221227125351044336131221 await
OP_AWAIT.
uint32_t iodev_flags
Op iodev flags.
Definition sqe.h:317
void * ccc_payload
OP_I3C_CCC.
Definition sqe.h:384
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@325336075103140057167073177100146101272354232055 tx
OP_TX.
struct rtio_sqe::@342363352172076106335370162240320153276337137375::@110162343014114265152332336213215220201374200140 rx
OP_RX.
int type
Configuration type, an enum i3c_config_type value.
Definition sqe.h:378
uint16_t flags
Op Flags.
Definition sqe.h:315
const uint8_t * buf
Buffer to write from.
Definition sqe.h:336
void * config
Configuration to apply.
Definition sqe.h:379
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:71
Header file for the Atomic operations API.
Misc utilities.