authorgravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-09-17 19:53:34+02:00
committergravatar for joran@ronomon.comJoran Dirk Greef <joran@ronomon.com> 2020-09-17 19:53:34+02:00
logd966fe63190de2992d6a7985bc492b9d9699d253
tree22ba92c09c7190f4d3ae802ccb8feb5fb9d243fc
parent21c81360ba40d645768d061723522116b6408d48

Add IORING_SQ_CQ_OVERFLOW to std/os/bits/linux.zig


2 files changed, 4 insertions(+), 4 deletions(-)

lib/std/io_uring.zig+1-4
......@@ -38,9 +38,6 @@ pub const io_uring_sqe = extern struct {
3838 options: [2]u64 = [2]u64{ 0, 0 }
3939};
4040
41// TODO Add to zig/std/os/bits/linux.zig:
42const IORING_SQ_CQ_OVERFLOW = 1 << 1;
43
4441comptime {
4542 assert(@sizeOf(io_uring_params) == 120);
4643 assert(@sizeOf(io_uring_sqe) == 64);
......@@ -315,7 +312,7 @@ pub const IO_Uring = struct {
315312
316313 // Matches the implementation of cq_ring_needs_flush() in liburing.
317314 fn cq_ring_needs_flush(self: *IO_Uring) bool {
318 return (@atomicLoad(u32, self.sq.flags, .Unordered) & IORING_SQ_CQ_OVERFLOW) != 0;
315 return (@atomicLoad(u32, self.sq.flags, .Unordered) & linux.IORING_SQ_CQ_OVERFLOW) != 0;
319316 }
320317
321318 /// For advanced use cases only that implement custom completion queue methods.
lib/std/os/bits/linux.zig+3
......@@ -1251,6 +1251,9 @@ pub const io_sqring_offsets = extern struct {
12511251/// needs io_uring_enter wakeup
12521252pub const IORING_SQ_NEED_WAKEUP = 1 << 0;
12531253
1254/// kernel has cqes waiting beyond the cq ring
1255pub const IORING_SQ_CQ_OVERFLOW = 1 << 1;
1256
12541257pub const io_cqring_offsets = extern struct {
12551258 head: u32,
12561259 tail: u32,