blob: fe2d0eb28a6ef19c534c193a50b46154ba69edca [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>
23struct io_uring_sqe {
24 __u8 opcode;
25 __u8 flags;
26 __u16 ioprio;
27 __s32 fd;
28 __u64 off;
29 __u64 addr;
30 __u32 len;
31 union {
32 __kernel_rwf_t rw_flags;
33 __u32 fsync_flags;
34 __u16 poll_events;
35 };
36 __u64 user_data;
37 union {
38 __u16 buf_index;
39 __u64 __pad2[3];
40 };
41};
42#define IOSQE_FIXED_FILE (1U << 0)
43#define IORING_SETUP_IOPOLL (1U << 0)
44#define IORING_SETUP_SQPOLL (1U << 1)
45#define IORING_SETUP_SQ_AFF (1U << 2)
46#define IORING_OP_NOP 0
47#define IORING_OP_READV 1
48#define IORING_OP_WRITEV 2
49#define IORING_OP_FSYNC 3
50#define IORING_OP_READ_FIXED 4
51#define IORING_OP_WRITE_FIXED 5
52#define IORING_OP_POLL_ADD 6
53#define IORING_OP_POLL_REMOVE 7
54#define IORING_FSYNC_DATASYNC (1U << 0)
55struct io_uring_cqe {
56 __u64 user_data;
57 __s32 res;
58 __u32 flags;
59};
60#define IORING_OFF_SQ_RING 0ULL
61#define IORING_OFF_CQ_RING 0x8000000ULL
62#define IORING_OFF_SQES 0x10000000ULL
63struct io_sqring_offsets {
64 __u32 head;
65 __u32 tail;
66 __u32 ring_mask;
67 __u32 ring_entries;
68 __u32 flags;
69 __u32 dropped;
70 __u32 array;
71 __u32 resv1;
72 __u64 resv2;
73};
74#define IORING_SQ_NEED_WAKEUP (1U << 0)
75struct io_cqring_offsets {
76 __u32 head;
77 __u32 tail;
78 __u32 ring_mask;
79 __u32 ring_entries;
80 __u32 overflow;
81 __u32 cqes;
82 __u64 resv[2];
83};
84#define IORING_ENTER_GETEVENTS (1U << 0)
85#define IORING_ENTER_SQ_WAKEUP (1U << 1)
86struct io_uring_params {
87 __u32 sq_entries;
88 __u32 cq_entries;
89 __u32 flags;
90 __u32 sq_thread_cpu;
91 __u32 sq_thread_idle;
92 __u32 resv[5];
93 struct io_sqring_offsets sq_off;
94 struct io_cqring_offsets cq_off;
95};
96#define IORING_REGISTER_BUFFERS 0
97#define IORING_UNREGISTER_BUFFERS 1
98#define IORING_REGISTER_FILES 2
99#define IORING_UNREGISTER_FILES 3
100#endif