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 {...@@ -38,9 +38,6 @@ pub const io_uring_sqe = extern struct {
38 options: [2]u64 = [2]u64{ 0, 0 }38 options: [2]u64 = [2]u64{ 0, 0 }
39};39};
4040
41// TODO Add to zig/std/os/bits/linux.zig:
42const IORING_SQ_CQ_OVERFLOW = 1 << 1;
43
44comptime {41comptime {
45 assert(@sizeOf(io_uring_params) == 120);42 assert(@sizeOf(io_uring_params) == 120);
46 assert(@sizeOf(io_uring_sqe) == 64);43 assert(@sizeOf(io_uring_sqe) == 64);
...@@ -315,7 +312,7 @@ pub const IO_Uring = struct {...@@ -315,7 +312,7 @@ pub const IO_Uring = struct {
315312
316 // Matches the implementation of cq_ring_needs_flush() in liburing.313 // Matches the implementation of cq_ring_needs_flush() in liburing.
317 fn cq_ring_needs_flush(self: *IO_Uring) bool {314 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;
319 }316 }
320317
321 /// For advanced use cases only that implement custom completion queue methods.318 /// 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 {...@@ -1251,6 +1251,9 @@ pub const io_sqring_offsets = extern struct {
1251/// needs io_uring_enter wakeup1251/// needs io_uring_enter wakeup
1252pub const IORING_SQ_NEED_WAKEUP = 1 << 0;1252pub 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
1254pub const io_cqring_offsets = extern struct {1257pub const io_cqring_offsets = extern struct {
1255 head: u32,1258 head: u32,
1256 tail: u32,1259 tail: u32,