|
|
| Line 101: |
Line 101: |
| The details of ring structure are typically only relevant when using the low-level API. Two offset structs are used to prepare and control the three (or two, see <tt>IORING_FEAT_SINGLE_MMAP</tt>) backing memory maps. | | The details of ring structure are typically only relevant when using the low-level API. Two offset structs are used to prepare and control the three (or two, see <tt>IORING_FEAT_SINGLE_MMAP</tt>) backing memory maps. |
| <syntaxhighlight lang="c"> | | <syntaxhighlight lang="c"> |
| struct io_uring_sq {
| |
| unsigned *khead;
| |
| unsigned *ktail;
| |
| // Deprecated: use `ring_mask` instead of `*kring_mask`
| |
| unsigned *kring_mask;
| |
| // Deprecated: use `ring_entries` instead of `*kring_entries`
| |
| unsigned *kring_entries;
| |
| unsigned *kflags;
| |
| unsigned *kdropped;
| |
| unsigned *array;
| |
| struct io_uring_sqe *sqes;
| |
|
| |
| unsigned sqe_head;
| |
| unsigned sqe_tail;
| |
|
| |
| size_t ring_sz;
| |
| void *ring_ptr;
| |
|
| |
| unsigned ring_mask;
| |
| unsigned ring_entries;
| |
|
| |
| unsigned pad[2];
| |
| };
| |
|
| |
| struct io_uring_cq {
| |
| unsigned *khead;
| |
| unsigned *ktail;
| |
| // Deprecated: use `ring_mask` instead of `*kring_mask`
| |
| unsigned *kring_mask;
| |
| // Deprecated: use `ring_entries` instead of `*kring_entries`
| |
| unsigned *kring_entries;
| |
| unsigned *kflags;
| |
| unsigned *koverflow;
| |
| struct io_uring_cqe *cqes;
| |
|
| |
| size_t ring_sz;
| |
| void *ring_ptr;
| |
|
| |
| unsigned ring_mask;
| |
| unsigned ring_entries;
| |
|
| |
| unsigned pad[2];
| |
| };
| |
|
| |
| struct io_sqring_offsets { | | struct io_sqring_offsets { |
| __u32 head; | | __u32 head; |