blob: 32c6c7b4106257d0c6bd5c756a7b64d6a2560866 [file] [log] [blame]
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef LINUX_IO_URING_H
20#define LINUX_IO_URING_H
21#include <linux/fs.h>
22#include <linux/types.h>
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080023#ifndef UAPI_LINUX_IO_URING_H_SKIP_LINUX_TIME_TYPES_H
Christopher Ferris7447a1c2022-10-04 18:24:44 -070024#include <linux/time_types.h>
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080025#endif
Christopher Ferris7447a1c2022-10-04 18:24:44 -070026#ifdef __cplusplus
27extern "C" {
28#endif
Christopher Ferris24f97eb2019-05-20 12:58:13 -070029struct io_uring_sqe {
30 __u8 opcode;
31 __u8 flags;
32 __u16 ioprio;
33 __s32 fd;
Christopher Ferrisd32ca142020-02-04 16:16:51 -080034 union {
35 __u64 off;
36 __u64 addr2;
Christopher Ferris80ae69d2022-08-02 16:32:21 -070037 struct {
38 __u32 cmd_op;
39 __u32 __pad1;
40 };
Christopher Ferrisd32ca142020-02-04 16:16:51 -080041 };
Christopher Ferrisaf09c702020-06-01 20:29:29 -070042 union {
43 __u64 addr;
44 __u64 splice_off_in;
45 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -070046 __u32 len;
47 union {
48 __kernel_rwf_t rw_flags;
49 __u32 fsync_flags;
50 __u16 poll_events;
Christopher Ferris25c18d42020-10-14 17:42:58 -070051 __u32 poll32_events;
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070052 __u32 sync_range_flags;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070053 __u32 msg_flags;
Christopher Ferris9584fa42019-12-09 15:36:13 -080054 __u32 timeout_flags;
Christopher Ferrisd32ca142020-02-04 16:16:51 -080055 __u32 accept_flags;
56 __u32 cancel_flags;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070057 __u32 open_flags;
58 __u32 statx_flags;
59 __u32 fadvise_advice;
Christopher Ferrisaf09c702020-06-01 20:29:29 -070060 __u32 splice_flags;
Christopher Ferris05667cd2021-02-16 16:01:34 -080061 __u32 rename_flags;
62 __u32 unlink_flags;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070063 __u32 hardlink_flags;
Christopher Ferris80ae69d2022-08-02 16:32:21 -070064 __u32 xattr_flags;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070065 __u32 msg_ring_flags;
Christopher Ferris6cd53a52022-12-12 23:39:16 +000066 __u32 uring_cmd_flags;
Christopher Ferris24f97eb2019-05-20 12:58:13 -070067 };
68 __u64 user_data;
69 union {
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000070 __u16 buf_index;
71 __u16 buf_group;
72 } __attribute__((packed));
73 __u16 personality;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070074 union {
75 __s32 splice_fd_in;
76 __u32 file_index;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070077 struct {
78 __u16 addr_len;
79 __u16 __pad3[1];
80 };
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070081 };
Christopher Ferris80ae69d2022-08-02 16:32:21 -070082 union {
83 struct {
84 __u64 addr3;
85 __u64 __pad2[1];
86 };
87 __u8 cmd[0];
88 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -070089};
Christopher Ferris80ae69d2022-08-02 16:32:21 -070090#define IORING_FILE_INDEX_ALLOC (~0U)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070091enum {
92 IOSQE_FIXED_FILE_BIT,
93 IOSQE_IO_DRAIN_BIT,
94 IOSQE_IO_LINK_BIT,
95 IOSQE_IO_HARDLINK_BIT,
96 IOSQE_ASYNC_BIT,
Christopher Ferrisaf09c702020-06-01 20:29:29 -070097 IOSQE_BUFFER_SELECT_BIT,
Christopher Ferris1ed55342022-03-22 16:06:25 -070098 IOSQE_CQE_SKIP_SUCCESS_BIT,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070099};
100#define IOSQE_FIXED_FILE (1U << IOSQE_FIXED_FILE_BIT)
101#define IOSQE_IO_DRAIN (1U << IOSQE_IO_DRAIN_BIT)
102#define IOSQE_IO_LINK (1U << IOSQE_IO_LINK_BIT)
103#define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT)
104#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700105#define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700106#define IOSQE_CQE_SKIP_SUCCESS (1U << IOSQE_CQE_SKIP_SUCCESS_BIT)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700107#define IORING_SETUP_IOPOLL (1U << 0)
108#define IORING_SETUP_SQPOLL (1U << 1)
109#define IORING_SETUP_SQ_AFF (1U << 2)
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800110#define IORING_SETUP_CQSIZE (1U << 3)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700111#define IORING_SETUP_CLAMP (1U << 4)
112#define IORING_SETUP_ATTACH_WQ (1U << 5)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800113#define IORING_SETUP_R_DISABLED (1U << 6)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700114#define IORING_SETUP_SUBMIT_ALL (1U << 7)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700115#define IORING_SETUP_COOP_TASKRUN (1U << 8)
116#define IORING_SETUP_TASKRUN_FLAG (1U << 9)
117#define IORING_SETUP_SQE128 (1U << 10)
118#define IORING_SETUP_CQE32 (1U << 11)
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700119#define IORING_SETUP_SINGLE_ISSUER (1U << 12)
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000120#define IORING_SETUP_DEFER_TASKRUN (1U << 13)
Christopher Ferris8666d042023-09-06 14:55:31 -0700121#define IORING_SETUP_NO_MMAP (1U << 14)
122#define IORING_SETUP_REGISTERED_FD_ONLY (1U << 15)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700123enum io_uring_op {
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800124 IORING_OP_NOP,
125 IORING_OP_READV,
126 IORING_OP_WRITEV,
127 IORING_OP_FSYNC,
128 IORING_OP_READ_FIXED,
129 IORING_OP_WRITE_FIXED,
130 IORING_OP_POLL_ADD,
131 IORING_OP_POLL_REMOVE,
132 IORING_OP_SYNC_FILE_RANGE,
133 IORING_OP_SENDMSG,
134 IORING_OP_RECVMSG,
135 IORING_OP_TIMEOUT,
136 IORING_OP_TIMEOUT_REMOVE,
137 IORING_OP_ACCEPT,
138 IORING_OP_ASYNC_CANCEL,
139 IORING_OP_LINK_TIMEOUT,
140 IORING_OP_CONNECT,
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700141 IORING_OP_FALLOCATE,
142 IORING_OP_OPENAT,
143 IORING_OP_CLOSE,
144 IORING_OP_FILES_UPDATE,
145 IORING_OP_STATX,
146 IORING_OP_READ,
147 IORING_OP_WRITE,
148 IORING_OP_FADVISE,
149 IORING_OP_MADVISE,
150 IORING_OP_SEND,
151 IORING_OP_RECV,
152 IORING_OP_OPENAT2,
153 IORING_OP_EPOLL_CTL,
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700154 IORING_OP_SPLICE,
155 IORING_OP_PROVIDE_BUFFERS,
156 IORING_OP_REMOVE_BUFFERS,
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700157 IORING_OP_TEE,
Christopher Ferris05667cd2021-02-16 16:01:34 -0800158 IORING_OP_SHUTDOWN,
159 IORING_OP_RENAMEAT,
160 IORING_OP_UNLINKAT,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700161 IORING_OP_MKDIRAT,
162 IORING_OP_SYMLINKAT,
163 IORING_OP_LINKAT,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700164 IORING_OP_MSG_RING,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700165 IORING_OP_FSETXATTR,
166 IORING_OP_SETXATTR,
167 IORING_OP_FGETXATTR,
168 IORING_OP_GETXATTR,
169 IORING_OP_SOCKET,
170 IORING_OP_URING_CMD,
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700171 IORING_OP_SEND_ZC,
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000172 IORING_OP_SENDMSG_ZC,
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800173 IORING_OP_LAST,
174};
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000175#define IORING_URING_CMD_FIXED (1U << 0)
Christopher Ferris8666d042023-09-06 14:55:31 -0700176#define IORING_URING_CMD_POLLED (1U << 31)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700177#define IORING_FSYNC_DATASYNC (1U << 0)
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800178#define IORING_TIMEOUT_ABS (1U << 0)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800179#define IORING_TIMEOUT_UPDATE (1U << 1)
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700180#define IORING_TIMEOUT_BOOTTIME (1U << 2)
181#define IORING_TIMEOUT_REALTIME (1U << 3)
182#define IORING_LINK_TIMEOUT_UPDATE (1U << 4)
Christopher Ferrisa4792612022-01-10 13:51:15 -0800183#define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5)
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700184#define IORING_TIMEOUT_MULTISHOT (1U << 6)
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700185#define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME)
186#define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700187#define SPLICE_F_FD_IN_FIXED (1U << 31)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000188#define IORING_POLL_ADD_MULTI (1U << 0)
189#define IORING_POLL_UPDATE_EVENTS (1U << 1)
190#define IORING_POLL_UPDATE_USER_DATA (1U << 2)
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700191#define IORING_POLL_ADD_LEVEL (1U << 3)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700192#define IORING_ASYNC_CANCEL_ALL (1U << 0)
193#define IORING_ASYNC_CANCEL_FD (1U << 1)
194#define IORING_ASYNC_CANCEL_ANY (1U << 2)
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700195#define IORING_ASYNC_CANCEL_FD_FIXED (1U << 3)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700196#define IORING_RECVSEND_POLL_FIRST (1U << 0)
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700197#define IORING_RECV_MULTISHOT (1U << 1)
198#define IORING_RECVSEND_FIXED_BUF (1U << 2)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800199#define IORING_SEND_ZC_REPORT_USAGE (1U << 3)
200#define IORING_NOTIF_USAGE_ZC_COPIED (1U << 31)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700201#define IORING_ACCEPT_MULTISHOT (1U << 0)
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700202enum {
203 IORING_MSG_DATA,
204 IORING_MSG_SEND_FD,
205};
206#define IORING_MSG_RING_CQE_SKIP (1U << 0)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000207#define IORING_MSG_RING_FLAGS_PASS (1U << 1)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700208struct io_uring_cqe {
209 __u64 user_data;
210 __s32 res;
211 __u32 flags;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700212 __u64 big_cqe[];
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700213};
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700214#define IORING_CQE_F_BUFFER (1U << 0)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000215#define IORING_CQE_F_MORE (1U << 1)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700216#define IORING_CQE_F_SOCK_NONEMPTY (1U << 2)
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700217#define IORING_CQE_F_NOTIF (1U << 3)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700218enum {
219 IORING_CQE_BUFFER_SHIFT = 16,
220};
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700221#define IORING_OFF_SQ_RING 0ULL
222#define IORING_OFF_CQ_RING 0x8000000ULL
223#define IORING_OFF_SQES 0x10000000ULL
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700224#define IORING_OFF_PBUF_RING 0x80000000ULL
225#define IORING_OFF_PBUF_SHIFT 16
226#define IORING_OFF_MMAP_MASK 0xf8000000ULL
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700227struct io_sqring_offsets {
228 __u32 head;
229 __u32 tail;
230 __u32 ring_mask;
231 __u32 ring_entries;
232 __u32 flags;
233 __u32 dropped;
234 __u32 array;
235 __u32 resv1;
Christopher Ferris8666d042023-09-06 14:55:31 -0700236 __u64 user_addr;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700237};
238#define IORING_SQ_NEED_WAKEUP (1U << 0)
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700239#define IORING_SQ_CQ_OVERFLOW (1U << 1)
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700240#define IORING_SQ_TASKRUN (1U << 2)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700241struct io_cqring_offsets {
242 __u32 head;
243 __u32 tail;
244 __u32 ring_mask;
245 __u32 ring_entries;
246 __u32 overflow;
247 __u32 cqes;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700248 __u32 flags;
249 __u32 resv1;
Christopher Ferris8666d042023-09-06 14:55:31 -0700250 __u64 user_addr;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700251};
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700252#define IORING_CQ_EVENTFD_DISABLED (1U << 0)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700253#define IORING_ENTER_GETEVENTS (1U << 0)
254#define IORING_ENTER_SQ_WAKEUP (1U << 1)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800255#define IORING_ENTER_SQ_WAIT (1U << 2)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800256#define IORING_ENTER_EXT_ARG (1U << 3)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700257#define IORING_ENTER_REGISTERED_RING (1U << 4)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700258struct io_uring_params {
259 __u32 sq_entries;
260 __u32 cq_entries;
261 __u32 flags;
262 __u32 sq_thread_cpu;
263 __u32 sq_thread_idle;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800264 __u32 features;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700265 __u32 wq_fd;
266 __u32 resv[3];
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700267 struct io_sqring_offsets sq_off;
268 struct io_cqring_offsets cq_off;
269};
Christopher Ferris9584fa42019-12-09 15:36:13 -0800270#define IORING_FEAT_SINGLE_MMAP (1U << 0)
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800271#define IORING_FEAT_NODROP (1U << 1)
272#define IORING_FEAT_SUBMIT_STABLE (1U << 2)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700273#define IORING_FEAT_RW_CUR_POS (1U << 3)
274#define IORING_FEAT_CUR_PERSONALITY (1U << 4)
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700275#define IORING_FEAT_FAST_POLL (1U << 5)
Christopher Ferris25c18d42020-10-14 17:42:58 -0700276#define IORING_FEAT_POLL_32BITS (1U << 6)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800277#define IORING_FEAT_SQPOLL_NONFIXED (1U << 7)
278#define IORING_FEAT_EXT_ARG (1U << 8)
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700279#define IORING_FEAT_NATIVE_WORKERS (1U << 9)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000280#define IORING_FEAT_RSRC_TAGS (1U << 10)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700281#define IORING_FEAT_CQE_SKIP (1U << 11)
Christopher Ferris10a76e62022-06-08 13:31:52 -0700282#define IORING_FEAT_LINKED_FILE (1U << 12)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000283#define IORING_FEAT_REG_REG_RING (1U << 13)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800284enum {
285 IORING_REGISTER_BUFFERS = 0,
286 IORING_UNREGISTER_BUFFERS = 1,
287 IORING_REGISTER_FILES = 2,
288 IORING_UNREGISTER_FILES = 3,
289 IORING_REGISTER_EVENTFD = 4,
290 IORING_UNREGISTER_EVENTFD = 5,
291 IORING_REGISTER_FILES_UPDATE = 6,
292 IORING_REGISTER_EVENTFD_ASYNC = 7,
293 IORING_REGISTER_PROBE = 8,
294 IORING_REGISTER_PERSONALITY = 9,
295 IORING_UNREGISTER_PERSONALITY = 10,
296 IORING_REGISTER_RESTRICTIONS = 11,
297 IORING_REGISTER_ENABLE_RINGS = 12,
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000298 IORING_REGISTER_FILES2 = 13,
299 IORING_REGISTER_FILES_UPDATE2 = 14,
300 IORING_REGISTER_BUFFERS2 = 15,
301 IORING_REGISTER_BUFFERS_UPDATE = 16,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000302 IORING_REGISTER_IOWQ_AFF = 17,
303 IORING_UNREGISTER_IOWQ_AFF = 18,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700304 IORING_REGISTER_IOWQ_MAX_WORKERS = 19,
Christopher Ferris10a76e62022-06-08 13:31:52 -0700305 IORING_REGISTER_RING_FDS = 20,
306 IORING_UNREGISTER_RING_FDS = 21,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700307 IORING_REGISTER_PBUF_RING = 22,
308 IORING_UNREGISTER_PBUF_RING = 23,
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700309 IORING_REGISTER_SYNC_CANCEL = 24,
310 IORING_REGISTER_FILE_ALLOC_RANGE = 25,
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000311 IORING_REGISTER_LAST,
312 IORING_REGISTER_USE_REGISTERED_RING = 1U << 31
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800313};
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700314enum {
315 IO_WQ_BOUND,
316 IO_WQ_UNBOUND,
317};
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800318struct io_uring_files_update {
319 __u32 offset;
320 __u32 resv;
321 __aligned_u64 fds;
322};
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700323#define IORING_RSRC_REGISTER_SPARSE (1U << 0)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000324struct io_uring_rsrc_register {
325 __u32 nr;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700326 __u32 flags;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000327 __u64 resv2;
328 __aligned_u64 data;
329 __aligned_u64 tags;
330};
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700331struct io_uring_rsrc_update {
332 __u32 offset;
333 __u32 resv;
334 __aligned_u64 data;
335};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000336struct io_uring_rsrc_update2 {
337 __u32 offset;
338 __u32 resv;
339 __aligned_u64 data;
340 __aligned_u64 tags;
341 __u32 nr;
342 __u32 resv2;
343};
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700344#define IORING_REGISTER_FILES_SKIP (- 2)
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700345#define IO_URING_OP_SUPPORTED (1U << 0)
346struct io_uring_probe_op {
347 __u8 op;
348 __u8 resv;
349 __u16 flags;
350 __u32 resv2;
351};
352struct io_uring_probe {
353 __u8 last_op;
354 __u8 ops_len;
355 __u16 resv;
356 __u32 resv2[3];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700357 struct io_uring_probe_op ops[];
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700358};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800359struct io_uring_restriction {
360 __u16 opcode;
361 union {
362 __u8 register_op;
363 __u8 sqe_op;
364 __u8 sqe_flags;
365 };
366 __u8 resv;
367 __u32 resv2[3];
368};
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700369struct io_uring_buf {
370 __u64 addr;
371 __u32 len;
372 __u16 bid;
373 __u16 resv;
374};
375struct io_uring_buf_ring {
376 union {
377 struct {
378 __u64 resv1;
379 __u32 resv2;
380 __u16 resv3;
381 __u16 tail;
382 };
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000383 __DECLARE_FLEX_ARRAY(struct io_uring_buf, bufs);
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700384 };
385};
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700386enum {
387 IOU_PBUF_RING_MMAP = 1,
388};
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700389struct io_uring_buf_reg {
390 __u64 ring_addr;
391 __u32 ring_entries;
392 __u16 bgid;
Christopher Ferris37c3f3c2023-07-10 10:59:05 -0700393 __u16 flags;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700394 __u64 resv[3];
395};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800396enum {
397 IORING_RESTRICTION_REGISTER_OP = 0,
398 IORING_RESTRICTION_SQE_OP = 1,
399 IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2,
400 IORING_RESTRICTION_SQE_FLAGS_REQUIRED = 3,
401 IORING_RESTRICTION_LAST
402};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800403struct io_uring_getevents_arg {
404 __u64 sigmask;
405 __u32 sigmask_sz;
406 __u32 pad;
407 __u64 ts;
408};
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700409struct io_uring_sync_cancel_reg {
410 __u64 addr;
411 __s32 fd;
412 __u32 flags;
413 struct __kernel_timespec timeout;
414 __u64 pad[4];
415};
416struct io_uring_file_index_range {
417 __u32 off;
418 __u32 len;
419 __u64 resv;
420};
421struct io_uring_recvmsg_out {
422 __u32 namelen;
423 __u32 controllen;
424 __u32 payloadlen;
425 __u32 flags;
426};
427#ifdef __cplusplus
428}
429#endif
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700430#endif