From 375bed76ba7292122f828fbf49c2b530506fdce8 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 20 May 2019 13:14:56 +0300 Subject: syscall: add support of non-x86 architectures Fortunately, all architectures except alpha have common numbers for new system calls nowadays, so support of non-alpha architectures is as simple as support of x86. Signed-off-by: Dmitry V. Levin Signed-off-by: Jens Axboe --- src/syscall.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/syscall.c b/src/syscall.c index 51cfb0f..2904153 100644 --- a/src/syscall.c +++ b/src/syscall.c @@ -8,18 +8,30 @@ #include "compat.h" #include "io_uring.h" -#if defined(__x86_64) || defined(__i386__) -#ifndef __NR_io_uring_setup -#define __NR_io_uring_setup 425 -#endif -#ifndef __NR_io_uring_enter -#define __NR_io_uring_enter 426 -#endif -#ifndef __NR_io_uring_register -#define __NR_io_uring_register 427 -#endif -#else -#error "Arch not supported yet" +#ifdef __alpha__ +/* + * alpha is the only exception, all other architectures + * have common numbers for new system calls. + */ +# ifndef __NR_io_uring_setup +# define __NR_io_uring_setup 535 +# endif +# ifndef __NR_io_uring_enter +# define __NR_io_uring_enter 536 +# endif +# ifndef __NR_io_uring_register +# define __NR_io_uring_register 537 +# endif +#else /* !__alpha__ */ +# ifndef __NR_io_uring_setup +# define __NR_io_uring_setup 425 +# endif +# ifndef __NR_io_uring_enter +# define __NR_io_uring_enter 426 +# endif +# ifndef __NR_io_uring_register +# define __NR_io_uring_register 427 +# endif #endif int io_uring_register(int fd, unsigned int opcode, void *arg, -- cgit