Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 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> |
| 23 | struct io_uring_sqe { |
| 24 | __u8 opcode; |
| 25 | __u8 flags; |
| 26 | __u16 ioprio; |
| 27 | __s32 fd; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 28 | union { |
| 29 | __u64 off; |
| 30 | __u64 addr2; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 31 | struct { |
| 32 | __u32 cmd_op; |
| 33 | __u32 __pad1; |
| 34 | }; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 35 | }; |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 36 | union { |
| 37 | __u64 addr; |
| 38 | __u64 splice_off_in; |
| 39 | }; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 40 | __u32 len; |
| 41 | union { |
| 42 | __kernel_rwf_t rw_flags; |
| 43 | __u32 fsync_flags; |
| 44 | __u16 poll_events; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 45 | __u32 poll32_events; |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 46 | __u32 sync_range_flags; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 47 | __u32 msg_flags; |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 48 | __u32 timeout_flags; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 49 | __u32 accept_flags; |
| 50 | __u32 cancel_flags; |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 51 | __u32 open_flags; |
| 52 | __u32 statx_flags; |
| 53 | __u32 fadvise_advice; |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 54 | __u32 splice_flags; |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 55 | __u32 rename_flags; |
| 56 | __u32 unlink_flags; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 57 | __u32 hardlink_flags; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 58 | __u32 xattr_flags; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 59 | }; |
| 60 | __u64 user_data; |
| 61 | union { |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 62 | __u16 buf_index; |
| 63 | __u16 buf_group; |
| 64 | } __attribute__((packed)); |
| 65 | __u16 personality; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 66 | union { |
| 67 | __s32 splice_fd_in; |
| 68 | __u32 file_index; |
| 69 | }; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 70 | union { |
| 71 | struct { |
| 72 | __u64 addr3; |
| 73 | __u64 __pad2[1]; |
| 74 | }; |
| 75 | __u8 cmd[0]; |
| 76 | }; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 77 | }; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 78 | #define IORING_FILE_INDEX_ALLOC (~0U) |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 79 | enum { |
| 80 | IOSQE_FIXED_FILE_BIT, |
| 81 | IOSQE_IO_DRAIN_BIT, |
| 82 | IOSQE_IO_LINK_BIT, |
| 83 | IOSQE_IO_HARDLINK_BIT, |
| 84 | IOSQE_ASYNC_BIT, |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 85 | IOSQE_BUFFER_SELECT_BIT, |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 86 | IOSQE_CQE_SKIP_SUCCESS_BIT, |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 87 | }; |
| 88 | #define IOSQE_FIXED_FILE (1U << IOSQE_FIXED_FILE_BIT) |
| 89 | #define IOSQE_IO_DRAIN (1U << IOSQE_IO_DRAIN_BIT) |
| 90 | #define IOSQE_IO_LINK (1U << IOSQE_IO_LINK_BIT) |
| 91 | #define IOSQE_IO_HARDLINK (1U << IOSQE_IO_HARDLINK_BIT) |
| 92 | #define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 93 | #define IOSQE_BUFFER_SELECT (1U << IOSQE_BUFFER_SELECT_BIT) |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 94 | #define IOSQE_CQE_SKIP_SUCCESS (1U << IOSQE_CQE_SKIP_SUCCESS_BIT) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 95 | #define IORING_SETUP_IOPOLL (1U << 0) |
| 96 | #define IORING_SETUP_SQPOLL (1U << 1) |
| 97 | #define IORING_SETUP_SQ_AFF (1U << 2) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 98 | #define IORING_SETUP_CQSIZE (1U << 3) |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 99 | #define IORING_SETUP_CLAMP (1U << 4) |
| 100 | #define IORING_SETUP_ATTACH_WQ (1U << 5) |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 101 | #define IORING_SETUP_R_DISABLED (1U << 6) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 102 | #define IORING_SETUP_SUBMIT_ALL (1U << 7) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 103 | #define IORING_SETUP_COOP_TASKRUN (1U << 8) |
| 104 | #define IORING_SETUP_TASKRUN_FLAG (1U << 9) |
| 105 | #define IORING_SETUP_SQE128 (1U << 10) |
| 106 | #define IORING_SETUP_CQE32 (1U << 11) |
| 107 | enum io_uring_op { |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 108 | IORING_OP_NOP, |
| 109 | IORING_OP_READV, |
| 110 | IORING_OP_WRITEV, |
| 111 | IORING_OP_FSYNC, |
| 112 | IORING_OP_READ_FIXED, |
| 113 | IORING_OP_WRITE_FIXED, |
| 114 | IORING_OP_POLL_ADD, |
| 115 | IORING_OP_POLL_REMOVE, |
| 116 | IORING_OP_SYNC_FILE_RANGE, |
| 117 | IORING_OP_SENDMSG, |
| 118 | IORING_OP_RECVMSG, |
| 119 | IORING_OP_TIMEOUT, |
| 120 | IORING_OP_TIMEOUT_REMOVE, |
| 121 | IORING_OP_ACCEPT, |
| 122 | IORING_OP_ASYNC_CANCEL, |
| 123 | IORING_OP_LINK_TIMEOUT, |
| 124 | IORING_OP_CONNECT, |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 125 | IORING_OP_FALLOCATE, |
| 126 | IORING_OP_OPENAT, |
| 127 | IORING_OP_CLOSE, |
| 128 | IORING_OP_FILES_UPDATE, |
| 129 | IORING_OP_STATX, |
| 130 | IORING_OP_READ, |
| 131 | IORING_OP_WRITE, |
| 132 | IORING_OP_FADVISE, |
| 133 | IORING_OP_MADVISE, |
| 134 | IORING_OP_SEND, |
| 135 | IORING_OP_RECV, |
| 136 | IORING_OP_OPENAT2, |
| 137 | IORING_OP_EPOLL_CTL, |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 138 | IORING_OP_SPLICE, |
| 139 | IORING_OP_PROVIDE_BUFFERS, |
| 140 | IORING_OP_REMOVE_BUFFERS, |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 141 | IORING_OP_TEE, |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 142 | IORING_OP_SHUTDOWN, |
| 143 | IORING_OP_RENAMEAT, |
| 144 | IORING_OP_UNLINKAT, |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 145 | IORING_OP_MKDIRAT, |
| 146 | IORING_OP_SYMLINKAT, |
| 147 | IORING_OP_LINKAT, |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 148 | IORING_OP_MSG_RING, |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 149 | IORING_OP_FSETXATTR, |
| 150 | IORING_OP_SETXATTR, |
| 151 | IORING_OP_FGETXATTR, |
| 152 | IORING_OP_GETXATTR, |
| 153 | IORING_OP_SOCKET, |
| 154 | IORING_OP_URING_CMD, |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 155 | IORING_OP_LAST, |
| 156 | }; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 157 | #define IORING_FSYNC_DATASYNC (1U << 0) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 158 | #define IORING_TIMEOUT_ABS (1U << 0) |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 159 | #define IORING_TIMEOUT_UPDATE (1U << 1) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 160 | #define IORING_TIMEOUT_BOOTTIME (1U << 2) |
| 161 | #define IORING_TIMEOUT_REALTIME (1U << 3) |
| 162 | #define IORING_LINK_TIMEOUT_UPDATE (1U << 4) |
Christopher Ferris | a479261 | 2022-01-10 13:51:15 -0800 | [diff] [blame] | 163 | #define IORING_TIMEOUT_ETIME_SUCCESS (1U << 5) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 164 | #define IORING_TIMEOUT_CLOCK_MASK (IORING_TIMEOUT_BOOTTIME | IORING_TIMEOUT_REALTIME) |
| 165 | #define IORING_TIMEOUT_UPDATE_MASK (IORING_TIMEOUT_UPDATE | IORING_LINK_TIMEOUT_UPDATE) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 166 | #define SPLICE_F_FD_IN_FIXED (1U << 31) |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 167 | #define IORING_POLL_ADD_MULTI (1U << 0) |
| 168 | #define IORING_POLL_UPDATE_EVENTS (1U << 1) |
| 169 | #define IORING_POLL_UPDATE_USER_DATA (1U << 2) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 170 | #define IORING_ASYNC_CANCEL_ALL (1U << 0) |
| 171 | #define IORING_ASYNC_CANCEL_FD (1U << 1) |
| 172 | #define IORING_ASYNC_CANCEL_ANY (1U << 2) |
| 173 | #define IORING_RECVSEND_POLL_FIRST (1U << 0) |
| 174 | #define IORING_ACCEPT_MULTISHOT (1U << 0) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 175 | struct io_uring_cqe { |
| 176 | __u64 user_data; |
| 177 | __s32 res; |
| 178 | __u32 flags; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 179 | __u64 big_cqe[]; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 180 | }; |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 181 | #define IORING_CQE_F_BUFFER (1U << 0) |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 182 | #define IORING_CQE_F_MORE (1U << 1) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 183 | #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 184 | enum { |
| 185 | IORING_CQE_BUFFER_SHIFT = 16, |
| 186 | }; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 187 | #define IORING_OFF_SQ_RING 0ULL |
| 188 | #define IORING_OFF_CQ_RING 0x8000000ULL |
| 189 | #define IORING_OFF_SQES 0x10000000ULL |
| 190 | struct io_sqring_offsets { |
| 191 | __u32 head; |
| 192 | __u32 tail; |
| 193 | __u32 ring_mask; |
| 194 | __u32 ring_entries; |
| 195 | __u32 flags; |
| 196 | __u32 dropped; |
| 197 | __u32 array; |
| 198 | __u32 resv1; |
| 199 | __u64 resv2; |
| 200 | }; |
| 201 | #define IORING_SQ_NEED_WAKEUP (1U << 0) |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 202 | #define IORING_SQ_CQ_OVERFLOW (1U << 1) |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 203 | #define IORING_SQ_TASKRUN (1U << 2) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 204 | struct io_cqring_offsets { |
| 205 | __u32 head; |
| 206 | __u32 tail; |
| 207 | __u32 ring_mask; |
| 208 | __u32 ring_entries; |
| 209 | __u32 overflow; |
| 210 | __u32 cqes; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 211 | __u32 flags; |
| 212 | __u32 resv1; |
| 213 | __u64 resv2; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 214 | }; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 215 | #define IORING_CQ_EVENTFD_DISABLED (1U << 0) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 216 | #define IORING_ENTER_GETEVENTS (1U << 0) |
| 217 | #define IORING_ENTER_SQ_WAKEUP (1U << 1) |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 218 | #define IORING_ENTER_SQ_WAIT (1U << 2) |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 219 | #define IORING_ENTER_EXT_ARG (1U << 3) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 220 | #define IORING_ENTER_REGISTERED_RING (1U << 4) |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 221 | struct io_uring_params { |
| 222 | __u32 sq_entries; |
| 223 | __u32 cq_entries; |
| 224 | __u32 flags; |
| 225 | __u32 sq_thread_cpu; |
| 226 | __u32 sq_thread_idle; |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 227 | __u32 features; |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 228 | __u32 wq_fd; |
| 229 | __u32 resv[3]; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 230 | struct io_sqring_offsets sq_off; |
| 231 | struct io_cqring_offsets cq_off; |
| 232 | }; |
Christopher Ferris | 9584fa4 | 2019-12-09 15:36:13 -0800 | [diff] [blame] | 233 | #define IORING_FEAT_SINGLE_MMAP (1U << 0) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 234 | #define IORING_FEAT_NODROP (1U << 1) |
| 235 | #define IORING_FEAT_SUBMIT_STABLE (1U << 2) |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 236 | #define IORING_FEAT_RW_CUR_POS (1U << 3) |
| 237 | #define IORING_FEAT_CUR_PERSONALITY (1U << 4) |
Christopher Ferris | af09c70 | 2020-06-01 20:29:29 -0700 | [diff] [blame] | 238 | #define IORING_FEAT_FAST_POLL (1U << 5) |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 239 | #define IORING_FEAT_POLL_32BITS (1U << 6) |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 240 | #define IORING_FEAT_SQPOLL_NONFIXED (1U << 7) |
| 241 | #define IORING_FEAT_EXT_ARG (1U << 8) |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 242 | #define IORING_FEAT_NATIVE_WORKERS (1U << 9) |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 243 | #define IORING_FEAT_RSRC_TAGS (1U << 10) |
Christopher Ferris | 1ed5534 | 2022-03-22 16:06:25 -0700 | [diff] [blame] | 244 | #define IORING_FEAT_CQE_SKIP (1U << 11) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 245 | #define IORING_FEAT_LINKED_FILE (1U << 12) |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 246 | enum { |
| 247 | IORING_REGISTER_BUFFERS = 0, |
| 248 | IORING_UNREGISTER_BUFFERS = 1, |
| 249 | IORING_REGISTER_FILES = 2, |
| 250 | IORING_UNREGISTER_FILES = 3, |
| 251 | IORING_REGISTER_EVENTFD = 4, |
| 252 | IORING_UNREGISTER_EVENTFD = 5, |
| 253 | IORING_REGISTER_FILES_UPDATE = 6, |
| 254 | IORING_REGISTER_EVENTFD_ASYNC = 7, |
| 255 | IORING_REGISTER_PROBE = 8, |
| 256 | IORING_REGISTER_PERSONALITY = 9, |
| 257 | IORING_UNREGISTER_PERSONALITY = 10, |
| 258 | IORING_REGISTER_RESTRICTIONS = 11, |
| 259 | IORING_REGISTER_ENABLE_RINGS = 12, |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 260 | IORING_REGISTER_FILES2 = 13, |
| 261 | IORING_REGISTER_FILES_UPDATE2 = 14, |
| 262 | IORING_REGISTER_BUFFERS2 = 15, |
| 263 | IORING_REGISTER_BUFFERS_UPDATE = 16, |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 264 | IORING_REGISTER_IOWQ_AFF = 17, |
| 265 | IORING_UNREGISTER_IOWQ_AFF = 18, |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 266 | IORING_REGISTER_IOWQ_MAX_WORKERS = 19, |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame] | 267 | IORING_REGISTER_RING_FDS = 20, |
| 268 | IORING_UNREGISTER_RING_FDS = 21, |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 269 | IORING_REGISTER_PBUF_RING = 22, |
| 270 | IORING_UNREGISTER_PBUF_RING = 23, |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 271 | IORING_REGISTER_LAST |
| 272 | }; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 273 | enum { |
| 274 | IO_WQ_BOUND, |
| 275 | IO_WQ_UNBOUND, |
| 276 | }; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 277 | struct io_uring_files_update { |
| 278 | __u32 offset; |
| 279 | __u32 resv; |
| 280 | __aligned_u64 fds; |
| 281 | }; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 282 | #define IORING_RSRC_REGISTER_SPARSE (1U << 0) |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 283 | struct io_uring_rsrc_register { |
| 284 | __u32 nr; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 285 | __u32 flags; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 286 | __u64 resv2; |
| 287 | __aligned_u64 data; |
| 288 | __aligned_u64 tags; |
| 289 | }; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 290 | struct io_uring_rsrc_update { |
| 291 | __u32 offset; |
| 292 | __u32 resv; |
| 293 | __aligned_u64 data; |
| 294 | }; |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 295 | struct io_uring_rsrc_update2 { |
| 296 | __u32 offset; |
| 297 | __u32 resv; |
| 298 | __aligned_u64 data; |
| 299 | __aligned_u64 tags; |
| 300 | __u32 nr; |
| 301 | __u32 resv2; |
| 302 | }; |
Christopher Ferris | a9750ed | 2021-05-03 14:02:49 -0700 | [diff] [blame] | 303 | #define IORING_REGISTER_FILES_SKIP (- 2) |
Christopher Ferris | bb9fcb4 | 2020-04-06 11:38:04 -0700 | [diff] [blame] | 304 | #define IO_URING_OP_SUPPORTED (1U << 0) |
| 305 | struct io_uring_probe_op { |
| 306 | __u8 op; |
| 307 | __u8 resv; |
| 308 | __u16 flags; |
| 309 | __u32 resv2; |
| 310 | }; |
| 311 | struct io_uring_probe { |
| 312 | __u8 last_op; |
| 313 | __u8 ops_len; |
| 314 | __u16 resv; |
| 315 | __u32 resv2[3]; |
| 316 | struct io_uring_probe_op ops[0]; |
| 317 | }; |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 318 | struct io_uring_restriction { |
| 319 | __u16 opcode; |
| 320 | union { |
| 321 | __u8 register_op; |
| 322 | __u8 sqe_op; |
| 323 | __u8 sqe_flags; |
| 324 | }; |
| 325 | __u8 resv; |
| 326 | __u32 resv2[3]; |
| 327 | }; |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame^] | 328 | struct io_uring_buf { |
| 329 | __u64 addr; |
| 330 | __u32 len; |
| 331 | __u16 bid; |
| 332 | __u16 resv; |
| 333 | }; |
| 334 | struct io_uring_buf_ring { |
| 335 | union { |
| 336 | struct { |
| 337 | __u64 resv1; |
| 338 | __u32 resv2; |
| 339 | __u16 resv3; |
| 340 | __u16 tail; |
| 341 | }; |
| 342 | struct io_uring_buf bufs[0]; |
| 343 | }; |
| 344 | }; |
| 345 | struct io_uring_buf_reg { |
| 346 | __u64 ring_addr; |
| 347 | __u32 ring_entries; |
| 348 | __u16 bgid; |
| 349 | __u16 pad; |
| 350 | __u64 resv[3]; |
| 351 | }; |
Christopher Ferris | 32ff3f8 | 2020-12-14 13:10:04 -0800 | [diff] [blame] | 352 | enum { |
| 353 | IORING_RESTRICTION_REGISTER_OP = 0, |
| 354 | IORING_RESTRICTION_SQE_OP = 1, |
| 355 | IORING_RESTRICTION_SQE_FLAGS_ALLOWED = 2, |
| 356 | IORING_RESTRICTION_SQE_FLAGS_REQUIRED = 3, |
| 357 | IORING_RESTRICTION_LAST |
| 358 | }; |
Christopher Ferris | 05667cd | 2021-02-16 16:01:34 -0800 | [diff] [blame] | 359 | struct io_uring_getevents_arg { |
| 360 | __u64 sigmask; |
| 361 | __u32 sigmask_sz; |
| 362 | __u32 pad; |
| 363 | __u64 ts; |
| 364 | }; |
Christopher Ferris | 24f97eb | 2019-05-20 12:58:13 -0700 | [diff] [blame] | 365 | #endif |