diff mbox series

[liburing,2/8] Update io_uring.h

Message ID 7f84430397941168cd4237590cad20578236184b.1731705935.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series update reg-wait to use region API | expand

Commit Message

Pavel Begunkov Nov. 15, 2024, 9:33 p.m. UTC
Remove the wait register opcode and add region registration
bits.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 src/include/liburing/io_uring.h | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 20bc570..b2adc3f 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -615,7 +615,7 @@  enum io_uring_register_op {
 
 	IORING_REGISTER_RESIZE_RINGS		= 33,
 
-	IORING_REGISTER_CQWAIT_REG		= 34,
+	IORING_REGISTER_MEM_REGION		= 34,
 
 	/* this goes last */
 	IORING_REGISTER_LAST,
@@ -637,6 +637,31 @@  struct io_uring_files_update {
 	__aligned_u64 /* __s32 * */ fds;
 };
 
+enum {
+	/* initialise with user provided memory pointed by user_addr */
+	IORING_MEM_REGION_TYPE_USER		= 1,
+};
+
+struct io_uring_region_desc {
+	__u64 user_addr;
+	__u64 size;
+	__u32 flags;
+	__u32 id;
+	__u64 mmap_offset;
+	__u64 __resv[4];
+};
+
+enum {
+	/* expose the region as registered wait arguments */
+	IORING_MEM_REGION_REG_WAIT_ARG		= 1,
+};
+
+struct io_uring_mem_region_reg {
+	__u64 region_uptr; /* struct io_uring_region_desc * */
+	__u64 flags;
+	__u64 __resv[2];
+};
+
 /*
  * Register a fully sparse file space, rather than pass in an array of all
  * -1 file descriptors.