Zephyr Project API  3.3.0
A Scalable Open Source RTOS
rtio_executor_concurrent.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#ifndef ZEPHYR_INCLUDE_RTIO_RTIO_EXECUTOR_CONCURRENT_H_
7#define ZEPHYR_INCLUDE_RTIO_RTIO_EXECUTOR_CONCURRENT_H_
8
9#include <zephyr/rtio/rtio.h>
10#include <zephyr/kernel.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
36
44void rtio_concurrent_ok(struct rtio *r, const struct rtio_sqe *sqe, int result);
45
53void rtio_concurrent_err(struct rtio *r, const struct rtio_sqe *sqe, int result);
54
63
64 /* Lock around the queues */
66
67 /* Task ring position and count */
69
70 /* First pending sqe to start when a task becomes available */
72
73 /* Last sqe seen from the most recent submit */
75
76 /* Array of task statuses */
78
79 /* Array of struct rtio_sqe *'s one per task' */
81};
82
86static const struct rtio_executor_api z_rtio_concurrent_api = {
90};
91
103#define RTIO_EXECUTOR_CONCURRENT_DEFINE(name, concurrency) \
104 static struct rtio_sqe *_task_cur_##name[(concurrency)]; \
105 uint8_t _task_status_##name[(concurrency)]; \
106 static struct rtio_concurrent_executor name = { \
107 .ctx = { .api = &z_rtio_concurrent_api }, \
108 .task_in = 0, \
109 .task_out = 0, \
110 .task_mask = (concurrency)-1, \
111 .pending_sqe = NULL, \
112 .last_sqe = NULL, \
113 .task_status = _task_status_##name, \
114 .task_cur = _task_cur_##name, \
115 };
116
121#ifdef __cplusplus
122}
123#endif
124
125
126#endif /* ZEPHYR_INCLUDE_RTIO_RTIO_EXECUTOR_CONCURRENT_H_ */
workaround assembler barfing for ST r
Definition: asm-macro-32-bit-gnu.h:24
void rtio_concurrent_err(struct rtio *r, const struct rtio_sqe *sqe, int result)
Report a SQE has completed with error.
void rtio_concurrent_ok(struct rtio *r, const struct rtio_sqe *sqe, int result)
Report a SQE has completed successfully.
int rtio_concurrent_submit(struct rtio *r)
Submit to the concurrent executor.
Public kernel APIs.
Real-Time IO device API for moving bytes with low effort.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Kernel Spin Lock.
Definition: spinlock.h:43
Definition: errno.c:37
Concurrent Executor.
Definition: rtio_executor_concurrent.h:61
struct k_spinlock lock
Definition: rtio_executor_concurrent.h:65
struct rtio_sqe * last_sqe
Definition: rtio_executor_concurrent.h:74
struct rtio_sqe * pending_sqe
Definition: rtio_executor_concurrent.h:71
struct rtio_executor ctx
Definition: rtio_executor_concurrent.h:62
uint16_t task_mask
Definition: rtio_executor_concurrent.h:68
uint8_t * task_status
Definition: rtio_executor_concurrent.h:77
struct rtio_sqe ** task_cur
Definition: rtio_executor_concurrent.h:80
uint16_t task_in
Definition: rtio_executor_concurrent.h:68
uint16_t task_out
Definition: rtio_executor_concurrent.h:68
Definition: rtio.h:168
int(* submit)(struct rtio *r)
Submit the request queue to executor.
Definition: rtio.h:177
An executor does the work of executing the submissions.
Definition: rtio.h:210
A submission queue event.
Definition: rtio.h:109
An RTIO queue pair that both the kernel and application work with.
Definition: rtio.h:222