File indexing completed on 2025-01-18 10:13:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef _VKI_IO_URING_H_
0023 #define _VKI_IO_URING_H_
0024
0025
0026
0027
0028
0029
0030 struct vki_io_uring_sqe {
0031 __vki_u8 opcode;
0032 __vki_u8 flags;
0033 __vki_u16 ioprio;
0034 __vki_s32 fd;
0035 __vki_u64 off;
0036 __vki_u64 addr;
0037 __vki_u32 len;
0038 union {
0039 int rw_flags;
0040 __vki_u32 fsync_flags;
0041 __vki_u16 poll_events;
0042 __vki_u32 sync_range_flags;
0043 __vki_u32 msg_flags;
0044 };
0045 __vki_u64 user_data;
0046 union {
0047 __vki_u16 buf_index;
0048 __vki_u64 __pad2[3];
0049 };
0050 };
0051
0052
0053
0054
0055 #define VKI_IOSQE_FIXED_FILE (1U << 0)
0056 #define VKI_IOSQE_IO_DRAIN (1U << 1)
0057 #define VKI_IOSQE_IO_LINK (1U << 2)
0058
0059
0060
0061
0062 #define VKI_IORING_SETUP_IOPOLL (1U << 0)
0063 #define VKI_IORING_SETUP_SQPOLL (1U << 1)
0064 #define VKI_IORING_SETUP_SQ_AFF (1U << 2)
0065
0066 #define VKI_IORING_OP_NOP 0
0067 #define VKI_IORING_OP_READV 1
0068 #define VKI_IORING_OP_WRITEV 2
0069 #define VKI_IORING_OP_FSYNC 3
0070 #define VKI_IORING_OP_READ_FIXED 4
0071 #define VKI_IORING_OP_WRITE_FIXED 5
0072 #define VKI_IORING_OP_POLL_ADD 6
0073 #define VKI_IORING_OP_POLL_REMOVE 7
0074 #define VKI_IORING_OP_SYNC_FILE_RANGE 8
0075 #define VKI_IORING_OP_SENDMSG 9
0076 #define VKI_IORING_OP_RECVMSG 10
0077
0078
0079
0080
0081 #define VKI_IORING_FSYNC_DATASYNC (1U << 0)
0082
0083
0084
0085
0086 struct vki_io_uring_cqe {
0087 __vki_u64 user_data;
0088 __vki_s32 res;
0089 __vki_u32 flags;
0090 };
0091
0092
0093
0094
0095 #define VKI_IORING_OFF_SQ_RING 0ULL
0096 #define VKI_IORING_OFF_CQ_RING 0x8000000ULL
0097 #define VKI_IORING_OFF_SQES 0x10000000ULL
0098
0099
0100
0101
0102 struct vki_io_sqring_offsets {
0103 __vki_u32 head;
0104 __vki_u32 tail;
0105 __vki_u32 ring_mask;
0106 __vki_u32 ring_entries;
0107 __vki_u32 flags;
0108 __vki_u32 dropped;
0109 __vki_u32 array;
0110 __vki_u32 resv1;
0111 __vki_u64 resv2;
0112 };
0113
0114
0115
0116
0117 #define VKI_IORING_SQ_NEED_WAKEUP (1U << 0)
0118
0119 struct vki_io_cqring_offsets {
0120 __vki_u32 head;
0121 __vki_u32 tail;
0122 __vki_u32 ring_mask;
0123 __vki_u32 ring_entries;
0124 __vki_u32 overflow;
0125 __vki_u32 cqes;
0126 __vki_u64 resv[2];
0127 };
0128
0129
0130
0131
0132 #define VKI_IORING_ENTER_GETEVENTS (1U << 0)
0133 #define VKI_IORING_ENTER_SQ_WAKEUP (1U << 1)
0134
0135
0136
0137
0138 struct vki_io_uring_params {
0139 __vki_u32 sq_entries;
0140 __vki_u32 cq_entries;
0141 __vki_u32 flags;
0142 __vki_u32 sq_thread_cpu;
0143 __vki_u32 sq_thread_idle;
0144 __vki_u32 resv[5];
0145 struct vki_io_sqring_offsets sq_off;
0146 struct vki_io_cqring_offsets cq_off;
0147 };
0148
0149
0150
0151
0152 #define VKI_IORING_REGISTER_BUFFERS 0
0153 #define VKI_IORING_UNREGISTER_BUFFERS 1
0154 #define VKI_IORING_REGISTER_FILES 2
0155 #define VKI_IORING_UNREGISTER_FILES 3
0156 #define VKI_IORING_REGISTER_EVENTFD 4
0157 #define VKI_IORING_UNREGISTER_EVENTFD 5
0158
0159 #endif