From b8bcd4c69fe658d5dcb3035fdb6c2704c3a761b4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 7 Dec 2020 13:32:04 +0900 Subject: [PATCH 1/5] missing: sort architectures in missing_syscall.h --- src/basic/missing_syscall.h | 264 ++++++++++++++++++------------------ 1 file changed, 133 insertions(+), 131 deletions(-) diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index daf01efc82..243f2daa51 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -15,13 +15,11 @@ #include #endif -#if defined(__x86_64__) && defined(__ILP32__) -# define systemd_SC_arch_bias(x) ((x) | /* __X32_SYSCALL_BIT */ 0x40000000) +#if defined(__alpha__) +# define systemd_SC_arch_bias(x) (110 + (x)) #elif defined(__ia64__) # define systemd_SC_arch_bias(x) (1024 + (x)) -#elif defined __alpha__ -# define systemd_SC_arch_bias(x) (110 + (x)) -#elif defined _MIPS_SIM +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_SC_arch_bias(x) (4000 + (x)) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -31,6 +29,8 @@ # else # error "Unknown MIPS ABI" # endif +#elif defined(__x86_64__) && defined(__ILP32__) +# define systemd_SC_arch_bias(x) ((x) | /* __X32_SYSCALL_BIT */ 0x40000000) #else # define systemd_SC_arch_bias(x) (x) #endif @@ -53,19 +53,17 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old) /* ======================================================================= */ -#if defined __x86_64__ -# define systemd_NR_memfd_create systemd_SC_arch_bias(319) -#elif defined __arm__ -# define systemd_NR_memfd_create 385 -#elif defined __aarch64__ +#if defined(__aarch64__) # define systemd_NR_memfd_create 279 -#elif defined __alpha__ +#elif defined(__alpha__) # define systemd_NR_memfd_create 512 -#elif defined(__powerpc__) -# define systemd_NR_memfd_create 360 -#elif defined __s390__ -# define systemd_NR_memfd_create 350 -#elif defined _MIPS_SIM +#elif defined(__arc__) +# define systemd_NR_memfd_create 279 +#elif defined(__arm__) +# define systemd_NR_memfd_create 385 +#elif defined(__i386__) +# define systemd_NR_memfd_create 356 +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_memfd_create systemd_SC_arch_bias(354) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -73,10 +71,12 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old) # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_memfd_create systemd_SC_arch_bias(314) # endif -#elif defined __i386__ -# define systemd_NR_memfd_create 356 -#elif defined __arc__ -# define systemd_NR_memfd_create 279 +#elif defined(__powerpc__) +# define systemd_NR_memfd_create 360 +#elif defined(__s390__) +# define systemd_NR_memfd_create 350 +#elif defined(__x86_64__) +# define systemd_NR_memfd_create systemd_SC_arch_bias(319) #else # warning "memfd_create() syscall number unknown for your architecture" #endif @@ -110,25 +110,21 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) { /* ======================================================================= */ -#if defined __x86_64__ -# define systemd_NR_getrandom systemd_SC_arch_bias(318) -#elif defined(__i386__) -# define systemd_NR_getrandom 355 -#elif defined(__arm__) -# define systemd_NR_getrandom 384 -#elif defined(__aarch64__) +#if defined(__aarch64__) # define systemd_NR_getrandom 278 #elif defined(__alpha__) # define systemd_NR_getrandom 511 +#elif defined(__arc__) +# define systemd_NR_getrandom 278 +#elif defined(__arm__) +# define systemd_NR_getrandom 384 +#elif defined(__i386__) +# define systemd_NR_getrandom 355 #elif defined(__ia64__) # define systemd_NR_getrandom systemd_SC_arch_bias(318) #elif defined(__m68k__) # define systemd_NR_getrandom 352 -#elif defined(__s390x__) -# define systemd_NR_getrandom 349 -#elif defined(__powerpc__) -# define systemd_NR_getrandom 359 -#elif defined _MIPS_SIM +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_getrandom systemd_SC_arch_bias(353) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -136,8 +132,12 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) { # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_getrandom systemd_SC_arch_bias(313) # endif -#elif defined(__arc__) -# define systemd_NR_getrandom 278 +#elif defined(__powerpc__) +# define systemd_NR_getrandom 359 +#elif defined(__s390x__) +# define systemd_NR_getrandom 349 +#elif defined(__x86_64__) +# define systemd_NR_getrandom systemd_SC_arch_bias(318) #else # warning "getrandom() syscall number unknown for your architecture" #endif @@ -186,23 +186,17 @@ static inline pid_t missing_gettid(void) { /* ======================================================================= */ -#if defined(__x86_64__) -# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303) -#elif defined(__i386__) -# define systemd_NR_name_to_handle_at 341 -#elif defined(__arm__) -# define systemd_NR_name_to_handle_at 370 -#elif defined __aarch64__ +#if defined(__aarch64__) # define systemd_NR_name_to_handle_at 264 #elif defined(__alpha__) # define systemd_NR_name_to_handle_at 497 -#elif defined(__powerpc__) -# define systemd_NR_name_to_handle_at 345 -#elif defined __s390__ || defined __s390x__ -# define systemd_NR_name_to_handle_at 335 #elif defined(__arc__) # define systemd_NR_name_to_handle_at 264 -#elif defined _MIPS_SIM +#elif defined(__arm__) +# define systemd_NR_name_to_handle_at 370 +#elif defined(__i386__) +# define systemd_NR_name_to_handle_at 341 +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(339) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -210,6 +204,12 @@ static inline pid_t missing_gettid(void) { # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(298) # endif +#elif defined(__powerpc__) +# define systemd_NR_name_to_handle_at 345 +#elif defined(__s390__) || defined(__s390x__) +# define systemd_NR_name_to_handle_at 335 +#elif defined(__x86_64__) +# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303) #else # warning "name_to_handle_at number is not defined" #endif @@ -249,23 +249,17 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil /* ======================================================================= */ -#if defined __aarch64__ +#if defined(__aarch64__) # define systemd_NR_setns 268 -#elif defined __arm__ -# define systemd_NR_setns 375 -#elif defined __alpha__ +#elif defined(__alpha__) # define systemd_NR_setns 501 -#elif defined(__x86_64__) -# define systemd_NR_setns systemd_SC_arch_bias(308) -#elif defined(__i386__) -# define systemd_NR_setns 346 -#elif defined(__powerpc__) -# define systemd_NR_setns 350 -#elif defined __s390__ || defined __s390x__ -# define systemd_NR_setns 339 #elif defined(__arc__) # define systemd_NR_setns 268 -#elif defined _MIPS_SIM +#elif defined(__arm__) +# define systemd_NR_setns 375 +#elif defined(__i386__) +# define systemd_NR_setns 346 +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_setns systemd_SC_arch_bias(344) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -273,6 +267,12 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_setns systemd_SC_arch_bias(303) # endif +#elif defined(__powerpc__) +# define systemd_NR_setns 350 +#elif defined(__s390__) || defined(__s390x__) +# define systemd_NR_setns 339 +#elif defined(__x86_64__) +# define systemd_NR_setns systemd_SC_arch_bias(308) #else # warning "setns() syscall number unknown for your architecture" #endif @@ -316,15 +316,17 @@ static inline pid_t raw_getpid(void) { /* ======================================================================= */ -#if defined __x86_64__ -# define systemd_NR_renameat2 systemd_SC_arch_bias(316) -#elif defined __arm__ -# define systemd_NR_renameat2 382 -#elif defined __aarch64__ +#if defined(__aarch64__) # define systemd_NR_renameat2 276 -#elif defined __alpha__ +#elif defined(__alpha__) # define systemd_NR_renameat2 510 -#elif defined _MIPS_SIM +#elif defined(__arc__) +# define systemd_NR_renameat2 276 +#elif defined(__arm__) +# define systemd_NR_renameat2 382 +#elif defined(__i386__) +# define systemd_NR_renameat2 353 +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_renameat2 systemd_SC_arch_bias(351) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -332,14 +334,12 @@ static inline pid_t raw_getpid(void) { # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_renameat2 systemd_SC_arch_bias(311) # endif -#elif defined __i386__ -# define systemd_NR_renameat2 353 -#elif defined __powerpc64__ +#elif defined(__powerpc64__) # define systemd_NR_renameat2 357 -#elif defined __s390__ || defined __s390x__ +#elif defined(__s390__) || defined(__s390x__) # define systemd_NR_renameat2 347 -#elif defined __arc__ -# define systemd_NR_renameat2 276 +#elif defined(__x86_64__) +# define systemd_NR_renameat2 systemd_SC_arch_bias(316) #else # warning "renameat2() syscall number unknown for your architecture" #endif @@ -425,23 +425,17 @@ static inline key_serial_t missing_request_key(const char *type, const char *des /* ======================================================================= */ -#if defined(__x86_64__) -# define systemd_NR_copy_file_range systemd_SC_arch_bias(326) +#if defined(__aarch64__) +# define systemd_NR_copy_file_range 285 +#elif defined(__alpha__) +# define systemd_NR_copy_file_range 519 +#elif defined(__arc__) +# define systemd_NR_copy_file_range 285 +#elif defined(__arm__) +# define systemd_NR_copy_file_range 391 #elif defined(__i386__) # define systemd_NR_copy_file_range 377 -#elif defined __s390__ -# define systemd_NR_copy_file_range 375 -#elif defined __arm__ -# define systemd_NR_copy_file_range 391 -#elif defined __aarch64__ -# define systemd_NR_copy_file_range 285 -#elif defined __alpha__ -# define systemd_NR_copy_file_range 519 -#elif defined __powerpc__ -# define systemd_NR_copy_file_range 379 -#elif defined __arc__ -# define systemd_NR_copy_file_range 285 -#elif defined _MIPS_SIM +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_copy_file_range systemd_SC_arch_bias(360) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -449,6 +443,12 @@ static inline key_serial_t missing_request_key(const char *type, const char *des # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_copy_file_range systemd_SC_arch_bias(320) # endif +#elif defined(__powerpc__) +# define systemd_NR_copy_file_range 379 +#elif defined(__s390__) +# define systemd_NR_copy_file_range 375 +#elif defined(__x86_64__) +# define systemd_NR_copy_file_range systemd_SC_arch_bias(326) #else # warning "copy_file_range() syscall number unknown for your architecture" #endif @@ -485,25 +485,15 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, /* ======================================================================= */ -#if defined __i386__ -# define systemd_NR_bpf 357 -#elif defined __x86_64__ -# define systemd_NR_bpf systemd_SC_arch_bias(321) -#elif defined __aarch64__ +#if defined(__aarch64__) # define systemd_NR_bpf 280 -#elif defined __arm__ -# define systemd_NR_bpf 386 -#elif defined __alpha__ +#elif defined(__alpha__) # define systemd_NR_bpf 515 -#elif defined(__powerpc__) -# define systemd_NR_bpf 361 -#elif defined __sparc__ -# define systemd_NR_bpf 349 -#elif defined __s390__ -# define systemd_NR_bpf 351 -#elif defined __tilegx__ -# define systemd_NR_bpf 280 -#elif defined _MIPS_SIM +#elif defined(__arm__) +# define systemd_NR_bpf 386 +#elif defined(__i386__) +# define systemd_NR_bpf 357 +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_bpf systemd_SC_arch_bias(355) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -511,6 +501,16 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_bpf systemd_SC_arch_bias(315) # endif +#elif defined(__powerpc__) +# define systemd_NR_bpf 361 +#elif defined(__s390__) +# define systemd_NR_bpf 351 +#elif defined(__sparc__) +# define systemd_NR_bpf 349 +#elif defined(__tilegx__) +# define systemd_NR_bpf 280 +#elif defined(__x86_64__) +# define systemd_NR_bpf systemd_SC_arch_bias(321) #else # warning "bpf() syscall number unknown for your architecture" #endif @@ -547,21 +547,15 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { /* ======================================================================= */ #ifndef __IGNORE_pkey_mprotect -# if defined __i386__ -# define systemd_NR_pkey_mprotect 380 -# elif defined __x86_64__ -# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(329) -# elif defined __aarch64__ +# if defined(__aarch64__) # define systemd_NR_pkey_mprotect 288 -# elif defined __arm__ -# define systemd_NR_pkey_mprotect 394 -# elif defined __alpha__ +# elif defined(__alpha__) # define systemd_NR_pkey_mprotect 524 -# elif defined __powerpc__ -# define systemd_NR_pkey_mprotect 386 -# elif defined __s390__ -# define systemd_NR_pkey_mprotect 384 -# elif defined _MIPS_SIM +# elif defined(__arm__) +# define systemd_NR_pkey_mprotect 394 +# elif defined(__i386__) +# define systemd_NR_pkey_mprotect 380 +# elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(363) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -569,6 +563,12 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(323) # endif +# elif defined(__powerpc__) +# define systemd_NR_pkey_mprotect 386 +# elif defined(__s390__) +# define systemd_NR_pkey_mprotect 384 +# elif defined(__x86_64__) +# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(329) # else # warning "pkey_mprotect() syscall number unknown for your architecture" # endif @@ -590,21 +590,15 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); /* ======================================================================= */ -#if defined __aarch64__ +#if defined(__aarch64__) # define systemd_NR_statx 291 -#elif defined __arm__ -# define systemd_NR_statx 397 -#elif defined __alpha__ +#elif defined(__alpha__) # define systemd_NR_statx 522 -#elif defined __i386__ || defined __powerpc64__ +#elif defined(__arm__) +# define systemd_NR_statx 397 +#elif defined(__i386__) # define systemd_NR_statx 383 -#elif defined __s390__ || defined __s390x__ -# define systemd_NR_statx 379 -#elif defined __sparc__ -# define systemd_NR_statx 360 -#elif defined __x86_64__ -# define systemd_NR_statx systemd_SC_arch_bias(332) -#elif defined _MIPS_SIM +#elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_statx systemd_SC_arch_bias(366) # elif _MIPS_SIM == _MIPS_SIM_NABI32 @@ -612,6 +606,14 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_statx systemd_SC_arch_bias(326) # endif +#elif defined(__powerpc64__) +# define systemd_NR_statx 383 +#elif defined(__s390__) || defined(__s390x__) +# define systemd_NR_statx 379 +#elif defined(__sparc__) +# define systemd_NR_statx 360 +#elif defined(__x86_64__) +# define systemd_NR_statx systemd_SC_arch_bias(332) #else # warning "statx() syscall number unknown for your architecture" #endif @@ -766,7 +768,7 @@ static inline int missing_rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *info) #endif /* ======================================================================= */ - + #if !HAVE_EXECVEAT static inline int missing_execveat(int dirfd, const char *pathname, char *const argv[], char *const envp[], @@ -778,7 +780,7 @@ static inline int missing_execveat(int dirfd, const char *pathname, return -1; # endif } - + # undef AT_EMPTY_PATH # define AT_EMPTY_PATH 0x1000 # define execveat missing_execveat From 86b863743550f22d3315c88e83277b676aa1c45d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Dec 2020 14:51:58 +0900 Subject: [PATCH 2/5] missing: support 32bit powerpc --- src/basic/missing_syscall.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index 243f2daa51..cfad9470a2 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -334,7 +334,7 @@ static inline pid_t raw_getpid(void) { # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_renameat2 systemd_SC_arch_bias(311) # endif -#elif defined(__powerpc64__) +#elif defined(__powerpc__) # define systemd_NR_renameat2 357 #elif defined(__s390__) || defined(__s390x__) # define systemd_NR_renameat2 347 @@ -606,7 +606,7 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); # elif _MIPS_SIM == _MIPS_SIM_ABI64 # define systemd_NR_statx systemd_SC_arch_bias(326) # endif -#elif defined(__powerpc64__) +#elif defined(__powerpc__) # define systemd_NR_statx 383 #elif defined(__s390__) || defined(__s390x__) # define systemd_NR_statx 379 From ae32a94efe1c1936322ce21c6f90a9a1a5af77a5 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Dec 2020 14:54:20 +0900 Subject: [PATCH 3/5] missing: drop redundant condition --- src/basic/missing_syscall.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index cfad9470a2..44fca18f02 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -134,7 +134,7 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) { # endif #elif defined(__powerpc__) # define systemd_NR_getrandom 359 -#elif defined(__s390x__) +#elif defined(__s390__) # define systemd_NR_getrandom 349 #elif defined(__x86_64__) # define systemd_NR_getrandom systemd_SC_arch_bias(318) @@ -206,7 +206,7 @@ static inline pid_t missing_gettid(void) { # endif #elif defined(__powerpc__) # define systemd_NR_name_to_handle_at 345 -#elif defined(__s390__) || defined(__s390x__) +#elif defined(__s390__) # define systemd_NR_name_to_handle_at 335 #elif defined(__x86_64__) # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303) @@ -269,7 +269,7 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil # endif #elif defined(__powerpc__) # define systemd_NR_setns 350 -#elif defined(__s390__) || defined(__s390x__) +#elif defined(__s390__) # define systemd_NR_setns 339 #elif defined(__x86_64__) # define systemd_NR_setns systemd_SC_arch_bias(308) @@ -336,7 +336,7 @@ static inline pid_t raw_getpid(void) { # endif #elif defined(__powerpc__) # define systemd_NR_renameat2 357 -#elif defined(__s390__) || defined(__s390x__) +#elif defined(__s390__) # define systemd_NR_renameat2 347 #elif defined(__x86_64__) # define systemd_NR_renameat2 systemd_SC_arch_bias(316) @@ -608,7 +608,7 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); # endif #elif defined(__powerpc__) # define systemd_NR_statx 383 -#elif defined(__s390__) || defined(__s390x__) +#elif defined(__s390__) # define systemd_NR_statx 379 #elif defined(__sparc__) # define systemd_NR_statx 360 From 6451baba82fa297b0042e3bcec0cb055ec7a0b5a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Dec 2020 14:59:45 +0900 Subject: [PATCH 4/5] missing: add missing syscalls for ia64, m68k, sparc, arc, and tilegx These are not tested, but several syscalls are defined for these architectures. Let's add syscalls comprehensively. --- src/basic/missing_syscall.h | 66 ++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index 44fca18f02..3911ccb983 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -57,12 +57,16 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old) # define systemd_NR_memfd_create 279 #elif defined(__alpha__) # define systemd_NR_memfd_create 512 -#elif defined(__arc__) +#elif defined(__arc__) || defined(__tilegx__) # define systemd_NR_memfd_create 279 #elif defined(__arm__) # define systemd_NR_memfd_create 385 #elif defined(__i386__) # define systemd_NR_memfd_create 356 +#elif defined(__ia64__) +# define systemd_NR_memfd_create systemd_SC_arch_bias(316) +#elif defined(__m68k__) +# define systemd_NR_memfd_create 353 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_memfd_create systemd_SC_arch_bias(354) @@ -75,6 +79,8 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old) # define systemd_NR_memfd_create 360 #elif defined(__s390__) # define systemd_NR_memfd_create 350 +#elif defined(__sparc__) +# define systemd_NR_memfd_create 348 #elif defined(__x86_64__) # define systemd_NR_memfd_create systemd_SC_arch_bias(319) #else @@ -114,7 +120,7 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) { # define systemd_NR_getrandom 278 #elif defined(__alpha__) # define systemd_NR_getrandom 511 -#elif defined(__arc__) +#elif defined(__arc__) || defined(__tilegx__) # define systemd_NR_getrandom 278 #elif defined(__arm__) # define systemd_NR_getrandom 384 @@ -136,6 +142,8 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) { # define systemd_NR_getrandom 359 #elif defined(__s390__) # define systemd_NR_getrandom 349 +#elif defined(__sparc__) +# define systemd_NR_getrandom 347 #elif defined(__x86_64__) # define systemd_NR_getrandom systemd_SC_arch_bias(318) #else @@ -190,12 +198,16 @@ static inline pid_t missing_gettid(void) { # define systemd_NR_name_to_handle_at 264 #elif defined(__alpha__) # define systemd_NR_name_to_handle_at 497 -#elif defined(__arc__) +#elif defined(__arc__) || defined(__tilegx__) # define systemd_NR_name_to_handle_at 264 #elif defined(__arm__) # define systemd_NR_name_to_handle_at 370 #elif defined(__i386__) # define systemd_NR_name_to_handle_at 341 +#elif defined(__ia64__) +# define systemd_NR_name_to_handle_at systemd_SC_arch_bias(302) +#elif defined(__m68k__) +# define systemd_NR_name_to_handle_at 340 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(339) @@ -208,6 +220,8 @@ static inline pid_t missing_gettid(void) { # define systemd_NR_name_to_handle_at 345 #elif defined(__s390__) # define systemd_NR_name_to_handle_at 335 +#elif defined(__sparc__) +# define systemd_NR_name_to_handle_at 332 #elif defined(__x86_64__) # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303) #else @@ -253,12 +267,16 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil # define systemd_NR_setns 268 #elif defined(__alpha__) # define systemd_NR_setns 501 -#elif defined(__arc__) +#elif defined(__arc__) || defined(__tilegx__) # define systemd_NR_setns 268 #elif defined(__arm__) # define systemd_NR_setns 375 #elif defined(__i386__) # define systemd_NR_setns 346 +#elif defined(__ia64__) +# define systemd_NR_setns systemd_SC_arch_bias(306) +#elif defined(__m68k__) +# define systemd_NR_setns 344 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_setns systemd_SC_arch_bias(344) @@ -271,6 +289,8 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil # define systemd_NR_setns 350 #elif defined(__s390__) # define systemd_NR_setns 339 +#elif defined(__sparc__) +# define systemd_NR_setns 337 #elif defined(__x86_64__) # define systemd_NR_setns systemd_SC_arch_bias(308) #else @@ -320,12 +340,16 @@ static inline pid_t raw_getpid(void) { # define systemd_NR_renameat2 276 #elif defined(__alpha__) # define systemd_NR_renameat2 510 -#elif defined(__arc__) +#elif defined(__arc__) || defined(__tilegx__) # define systemd_NR_renameat2 276 #elif defined(__arm__) # define systemd_NR_renameat2 382 #elif defined(__i386__) # define systemd_NR_renameat2 353 +#elif defined(__ia64__) +# define systemd_NR_renameat2 systemd_SC_arch_bias(314) +#elif defined(__m68k__) +# define systemd_NR_renameat2 351 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_renameat2 systemd_SC_arch_bias(351) @@ -338,6 +362,8 @@ static inline pid_t raw_getpid(void) { # define systemd_NR_renameat2 357 #elif defined(__s390__) # define systemd_NR_renameat2 347 +#elif defined(__sparc__) +# define systemd_NR_renameat2 345 #elif defined(__x86_64__) # define systemd_NR_renameat2 systemd_SC_arch_bias(316) #else @@ -429,12 +455,16 @@ static inline key_serial_t missing_request_key(const char *type, const char *des # define systemd_NR_copy_file_range 285 #elif defined(__alpha__) # define systemd_NR_copy_file_range 519 -#elif defined(__arc__) +#elif defined(__arc__) || defined(__tilegx__) # define systemd_NR_copy_file_range 285 #elif defined(__arm__) # define systemd_NR_copy_file_range 391 #elif defined(__i386__) # define systemd_NR_copy_file_range 377 +#elif defined(__ia64__) +# define systemd_NR_copy_file_range systemd_SC_arch_bias(323) +#elif defined(__m68k__) +# define systemd_NR_copy_file_range 376 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_copy_file_range systemd_SC_arch_bias(360) @@ -447,6 +477,8 @@ static inline key_serial_t missing_request_key(const char *type, const char *des # define systemd_NR_copy_file_range 379 #elif defined(__s390__) # define systemd_NR_copy_file_range 375 +#elif defined(__sparc__) +# define systemd_NR_copy_file_range 357 #elif defined(__x86_64__) # define systemd_NR_copy_file_range systemd_SC_arch_bias(326) #else @@ -489,10 +521,16 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, # define systemd_NR_bpf 280 #elif defined(__alpha__) # define systemd_NR_bpf 515 +#elif defined(__arc__) || defined(__tilegx__) +# define systemd_NR_bpf 280 #elif defined(__arm__) # define systemd_NR_bpf 386 #elif defined(__i386__) # define systemd_NR_bpf 357 +#elif defined(__ia64__) +# define systemd_NR_bpf systemd_SC_arch_bias(317) +#elif defined(__m68k__) +# define systemd_NR_bpf 354 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_bpf systemd_SC_arch_bias(355) @@ -507,8 +545,6 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, # define systemd_NR_bpf 351 #elif defined(__sparc__) # define systemd_NR_bpf 349 -#elif defined(__tilegx__) -# define systemd_NR_bpf 280 #elif defined(__x86_64__) # define systemd_NR_bpf systemd_SC_arch_bias(321) #else @@ -551,10 +587,16 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { # define systemd_NR_pkey_mprotect 288 # elif defined(__alpha__) # define systemd_NR_pkey_mprotect 524 +# elif defined(__arc__) || defined(__tilegx__) +# define systemd_NR_pkey_mprotect 226 # elif defined(__arm__) # define systemd_NR_pkey_mprotect 394 # elif defined(__i386__) # define systemd_NR_pkey_mprotect 380 +# elif defined(__ia64__) +# define systemd_NR_pkey_mprotect systemd_SC_arch_bias(330) +# elif defined(__m68k__) +# define systemd_NR_pkey_mprotect 381 # elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(363) @@ -567,6 +609,8 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { # define systemd_NR_pkey_mprotect 386 # elif defined(__s390__) # define systemd_NR_pkey_mprotect 384 +# elif defined(__sparc__) +# define systemd_NR_pkey_mprotect 362 # elif defined(__x86_64__) # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(329) # else @@ -594,10 +638,16 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); # define systemd_NR_statx 291 #elif defined(__alpha__) # define systemd_NR_statx 522 +#elif defined(__arc__) || defined(__tilegx__) +# define systemd_NR_statx 291 #elif defined(__arm__) # define systemd_NR_statx 397 #elif defined(__i386__) # define systemd_NR_statx 383 +#elif defined(__ia64__) +# define systemd_NR_statx systemd_SC_arch_bias(326) +#elif defined(__m68k__) +# define systemd_NR_statx 379 #elif defined(_MIPS_SIM) # if _MIPS_SIM == _MIPS_SIM_ABI32 # define systemd_NR_statx systemd_SC_arch_bias(366) From 105bfc9e7230d0647d7df4dbdeae1543ac2f8823 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 8 Dec 2020 15:35:57 +0900 Subject: [PATCH 5/5] missing: update warning messages --- src/basic/missing_syscall.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/basic/missing_syscall.h b/src/basic/missing_syscall.h index 3911ccb983..06166b3fb3 100644 --- a/src/basic/missing_syscall.h +++ b/src/basic/missing_syscall.h @@ -84,7 +84,7 @@ static inline int missing_pivot_root(const char *new_root, const char *put_old) #elif defined(__x86_64__) # define systemd_NR_memfd_create systemd_SC_arch_bias(319) #else -# warning "memfd_create() syscall number unknown for your architecture" +# warning "memfd_create() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -147,7 +147,7 @@ static inline int missing_memfd_create(const char *name, unsigned int flags) { #elif defined(__x86_64__) # define systemd_NR_getrandom systemd_SC_arch_bias(318) #else -# warning "getrandom() syscall number unknown for your architecture" +# warning "getrandom() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -225,7 +225,7 @@ static inline pid_t missing_gettid(void) { #elif defined(__x86_64__) # define systemd_NR_name_to_handle_at systemd_SC_arch_bias(303) #else -# warning "name_to_handle_at number is not defined" +# warning "name_to_handle_at() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -294,7 +294,7 @@ static inline int missing_name_to_handle_at(int fd, const char *name, struct fil #elif defined(__x86_64__) # define systemd_NR_setns systemd_SC_arch_bias(308) #else -# warning "setns() syscall number unknown for your architecture" +# warning "setns() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -367,7 +367,7 @@ static inline pid_t raw_getpid(void) { #elif defined(__x86_64__) # define systemd_NR_renameat2 systemd_SC_arch_bias(316) #else -# warning "renameat2() syscall number unknown for your architecture" +# warning "renameat2() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -482,7 +482,7 @@ static inline key_serial_t missing_request_key(const char *type, const char *des #elif defined(__x86_64__) # define systemd_NR_copy_file_range systemd_SC_arch_bias(326) #else -# warning "copy_file_range() syscall number unknown for your architecture" +# warning "copy_file_range() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -548,7 +548,7 @@ static inline ssize_t missing_copy_file_range(int fd_in, loff_t *off_in, #elif defined(__x86_64__) # define systemd_NR_bpf systemd_SC_arch_bias(321) #else -# warning "bpf() syscall number unknown for your architecture" +# warning "bpf() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -614,7 +614,7 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) { # elif defined(__x86_64__) # define systemd_NR_pkey_mprotect systemd_SC_arch_bias(329) # else -# warning "pkey_mprotect() syscall number unknown for your architecture" +# warning "pkey_mprotect() syscall number is unknown for your architecture" # endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */ @@ -665,7 +665,7 @@ assert_cc(__NR_pkey_mprotect == systemd_NR_pkey_mprotect); #elif defined(__x86_64__) # define systemd_NR_statx systemd_SC_arch_bias(332) #else -# warning "statx() syscall number unknown for your architecture" +# warning "statx() syscall number is unknown for your architecture" #endif /* may be (invalid) negative number due to libseccomp, see PR 13319 */