Signed-off-by: Gabriel Krisman Bertazi --- src/include/liburing.h | 8 ++++++++ src/include/liburing/io_uring.h | 10 ++++++++++ src/liburing-ffi.map | 2 ++ 3 files changed, 20 insertions(+) diff --git a/src/include/liburing.h b/src/include/liburing.h index 861e9673..903c60b7 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -1669,6 +1669,14 @@ IOURINGINLINE void io_uring_prep_pipe(struct io_uring_sqe *sqe, int *fds, sqe->pipe_flags = (__u32) pipe_flags; } +IOURINGINLINE void io_uring_prep_mmap(struct io_uring_sqe *sqe, int fd, + struct io_uring_mmap_desc *descs, + int nr_maps, int flags) +{ + io_uring_prep_rw(IORING_OP_MMAP, sqe, fd, descs, nr_maps, 0); + sqe->mmap_flags = flags; +} + /* setup pipe directly into the fixed file table */ IOURINGINLINE void io_uring_prep_pipe_direct(struct io_uring_sqe *sqe, int *fds, int pipe_flags, diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h index 3e88e796..2e1ac37d 100644 --- a/src/include/liburing/io_uring.h +++ b/src/include/liburing/io_uring.h @@ -74,6 +74,7 @@ struct io_uring_sqe { __u32 install_fd_flags; __u32 nop_flags; __u32 pipe_flags; + __u32 mmap_flags; }; __u64 user_data; /* data to be passed back at completion time */ /* pack this to avoid bogus arm OABI complaints */ @@ -311,6 +312,7 @@ enum io_uring_op { IORING_OP_PIPE, IORING_OP_NOP128, IORING_OP_URING_CMD128, + IORING_OP_MMAP, /* this goes last, obviously */ IORING_OP_LAST, @@ -1069,6 +1071,14 @@ struct io_uring_zcrx_ifq_reg { __u64 __resv[3]; }; +struct io_uring_mmap_desc { + void *addr; + unsigned long len; + unsigned long pgoff; + unsigned int prot; + unsigned int flags; +}; + #ifdef __cplusplus } #endif diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map index 7202ffd0..b16de5aa 100644 --- a/src/liburing-ffi.map +++ b/src/liburing-ffi.map @@ -264,4 +264,6 @@ LIBURING_2.13 { LIBURING_2.14 { global: io_uring_register_task_restrictions; + io_uring_prep_mmap; + } LIBURING_2.13; -- 2.52.0