diff options
Diffstat (limited to 'tools/io_uring/syscall.c')
| -rw-r--r-- | tools/io_uring/syscall.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/tools/io_uring/syscall.c b/tools/io_uring/syscall.c index 6b835e5c6a5b..b22e0aa54e9d 100644 --- a/tools/io_uring/syscall.c +++ b/tools/io_uring/syscall.c | |||
| @@ -7,34 +7,46 @@ | |||
| 7 | #include <signal.h> | 7 | #include <signal.h> |
| 8 | #include "liburing.h" | 8 | #include "liburing.h" |
| 9 | 9 | ||
| 10 | #if defined(__x86_64) || defined(__i386__) | 10 | #ifdef __alpha__ |
| 11 | #ifndef __NR_sys_io_uring_setup | 11 | /* |
| 12 | #define __NR_sys_io_uring_setup 425 | 12 | * alpha is the only exception, all other architectures |
| 13 | #endif | 13 | * have common numbers for new system calls. |
| 14 | #ifndef __NR_sys_io_uring_enter | 14 | */ |
| 15 | #define __NR_sys_io_uring_enter 426 | 15 | # ifndef __NR_io_uring_setup |
| 16 | #endif | 16 | # define __NR_io_uring_setup 535 |
| 17 | #ifndef __NR_sys_io_uring_register | 17 | # endif |
| 18 | #define __NR_sys_io_uring_register 427 | 18 | # ifndef __NR_io_uring_enter |
| 19 | #endif | 19 | # define __NR_io_uring_enter 536 |
| 20 | #else | 20 | # endif |
| 21 | #error "Arch not supported yet" | 21 | # ifndef __NR_io_uring_register |
| 22 | # define __NR_io_uring_register 537 | ||
| 23 | # endif | ||
| 24 | #else /* !__alpha__ */ | ||
| 25 | # ifndef __NR_io_uring_setup | ||
| 26 | # define __NR_io_uring_setup 425 | ||
| 27 | # endif | ||
| 28 | # ifndef __NR_io_uring_enter | ||
| 29 | # define __NR_io_uring_enter 426 | ||
| 30 | # endif | ||
| 31 | # ifndef __NR_io_uring_register | ||
| 32 | # define __NR_io_uring_register 427 | ||
| 33 | # endif | ||
| 22 | #endif | 34 | #endif |
| 23 | 35 | ||
| 24 | int io_uring_register(int fd, unsigned int opcode, void *arg, | 36 | int io_uring_register(int fd, unsigned int opcode, void *arg, |
| 25 | unsigned int nr_args) | 37 | unsigned int nr_args) |
| 26 | { | 38 | { |
| 27 | return syscall(__NR_sys_io_uring_register, fd, opcode, arg, nr_args); | 39 | return syscall(__NR_io_uring_register, fd, opcode, arg, nr_args); |
| 28 | } | 40 | } |
| 29 | 41 | ||
| 30 | int io_uring_setup(unsigned entries, struct io_uring_params *p) | 42 | int io_uring_setup(unsigned int entries, struct io_uring_params *p) |
| 31 | { | 43 | { |
| 32 | return syscall(__NR_sys_io_uring_setup, entries, p); | 44 | return syscall(__NR_io_uring_setup, entries, p); |
| 33 | } | 45 | } |
| 34 | 46 | ||
| 35 | int io_uring_enter(unsigned fd, unsigned to_submit, unsigned min_complete, | 47 | int io_uring_enter(int fd, unsigned int to_submit, unsigned int min_complete, |
| 36 | unsigned flags, sigset_t *sig) | 48 | unsigned int flags, sigset_t *sig) |
| 37 | { | 49 | { |
| 38 | return syscall(__NR_sys_io_uring_enter, fd, to_submit, min_complete, | 50 | return syscall(__NR_io_uring_enter, fd, to_submit, min_complete, |
| 39 | flags, sig, _NSIG / 8); | 51 | flags, sig, _NSIG / 8); |
| 40 | } | 52 | } |
