From aaf86e1aa213e0adcee3baa60fb17891d794ce95 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 12 May 2019 22:45:45 +0000 Subject: [PATCH] Implement and use new parsers of semtimedop syscall * ipc_sem.c (SYS_FUNC(semtimedop)): Remove. [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(semtimedop_time32)): New function. * linux/subcall32.h (sys_semtimedop): Redirect to sys_semtimedop_time32. * linux/subcall64.h (sys_semtimedop): Redirect to sys_semtimedop_time64. * linux/64/syscallent.h: Replace SEN(semtimedop) with SEN(semtimedop_time64). * linux/alpha/syscallent.h: Likewise. * linux/ia64/syscallent.h: Likewise. * linux/mips/syscallent-n64.h: Likewise. * linux/powerpc64/syscallent.h: Likewise. * linux/s390x/syscallent.h: Likewise. * linux/sparc64/syscallent.h: Likewise. * linux/x32/syscallent.h: Likewise. * linux/x86_64/syscallent.h: Likewise. * linux/32/syscallent.h: Replace SEN(semtimedop) with SEN(semtimedop_time32). * linux/arm/syscallent.h: Likewise. * linux/avr32/syscallent.h: Likewise. * linux/bfin/syscallent.h: Likewise. * linux/hppa/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent-n32.h: Likewise. * linux/xtensa/syscallent.h: Likewise. --- ipc_sem.c | 6 ++++-- linux/32/syscallent.h | 2 +- linux/64/syscallent.h | 2 +- linux/alpha/syscallent.h | 2 +- linux/arm/syscallent.h | 2 +- linux/avr32/syscallent.h | 2 +- linux/bfin/syscallent.h | 2 +- linux/hppa/syscallent.h | 2 +- linux/ia64/syscallent.h | 2 +- linux/microblaze/syscallent.h | 2 +- linux/mips/syscallent-n32.h | 2 +- linux/mips/syscallent-n64.h | 2 +- linux/powerpc64/syscallent.h | 2 +- linux/s390x/syscallent.h | 2 +- linux/sparc64/syscallent.h | 2 +- linux/subcall32.h | 2 ++ linux/subcall64.h | 2 ++ linux/x32/syscallent.h | 2 +- linux/x86_64/syscallent.h | 2 +- linux/xtensa/syscallent.h | 2 +- 20 files changed, 25 insertions(+), 19 deletions(-) diff --git a/ipc_sem.c b/ipc_sem.c index 908a58c4..5c8be6ae 100644 --- a/ipc_sem.c +++ b/ipc_sem.c @@ -82,10 +82,12 @@ do_semtimedop(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) return RVAL_DECODED; } -SYS_FUNC(semtimedop) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(semtimedop_time32) { - return do_semtimedop(tcp, print_timespec); + return do_semtimedop(tcp, print_timespec32); } +#endif SYS_FUNC(semtimedop_time64) { diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h index 9ee22822..efd5b264 100644 --- a/linux/32/syscallent.h +++ b/linux/32/syscallent.h @@ -204,7 +204,7 @@ [189] = { 4, TI, SEN(msgsnd), "msgsnd" }, [190] = { 3, TI, SEN(semget), "semget" }, [191] = { 4, TI, SEN(semctl), "semctl" }, -[192] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[192] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [193] = { 3, TI, SEN(semop), "semop" }, [194] = { 3, TI, SEN(shmget), "shmget" }, [195] = { 3, TI, SEN(shmctl), "shmctl" }, diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h index 6106a95b..4d2c3ee5 100644 --- a/linux/64/syscallent.h +++ b/linux/64/syscallent.h @@ -197,7 +197,7 @@ [189] = { 4, TI, SEN(msgsnd), "msgsnd" }, [190] = { 3, TI, SEN(semget), "semget" }, [191] = { 4, TI, SEN(semctl), "semctl" }, -[192] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[192] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [193] = { 3, TI, SEN(semop), "semop" }, [194] = { 3, TI, SEN(shmget), "shmget" }, [195] = { 3, TI, SEN(shmctl), "shmctl" }, diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index d001a97a..9cfcc588 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -366,7 +366,7 @@ [420] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, [421] = { 2, 0, SEN(clock_getres), "clock_getres" }, [422] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[423] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[423] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [424] = { 3, TS, SEN(tgkill), "tgkill" }, [425] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, [426] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index 7bc4ac58..dadcccd3 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -319,7 +319,7 @@ [309] = { 5, 0, SEN(add_key), "add_key" }, [310] = { 4, 0, SEN(request_key), "request_key" }, [311] = { 5, 0, SEN(keyctl), "keyctl" }, -[312] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[312] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [313] = { 5, 0, SEN(vserver), "vserver" }, [314] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [315] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h index 30082d69..d6cc1b08 100644 --- a/linux/avr32/syscallent.h +++ b/linux/avr32/syscallent.h @@ -279,7 +279,7 @@ [270] = { 3, TI, SEN(semget), "semget" }, [271] = { 3, TI, SEN(semop), "semop" }, [272] = { 4, TI, SEN(semctl), "semctl" }, -[273] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[273] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [274] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, [275] = { 3, TI, SEN(shmget), "shmget" }, [276] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h index 21fe89bd..e124fd3d 100644 --- a/linux/bfin/syscallent.h +++ b/linux/bfin/syscallent.h @@ -363,7 +363,7 @@ [354] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [355] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, [356] = { 6, TD, SEN(fallocate), "fallocate" }, -[357] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[357] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [358] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, [359] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, [360] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h index ebbceaa2..7c280c84 100644 --- a/linux/hppa/syscallent.h +++ b/linux/hppa/syscallent.h @@ -231,7 +231,7 @@ [225] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, [226] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [227] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, -[228] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[228] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [229] = { 4, TD, SEN(mq_open), "mq_open" }, [230] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, [231] = { 5, TD, SEN(mq_timedsend), "mq_timedsend" }, diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index f86a4c05..4edb07a2 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -230,7 +230,7 @@ [1024 + 220] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, [1024 + 221] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [1024 + 222] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[1024 + 223] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[1024 + 223] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [1024 + 224] = { 3, 0, SEN(timer_create), "timer_create" }, [1024 + 225] = { 4, 0, SEN(timer_settime), "timer_settime" }, [1024 + 226] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h index 7e9eaa64..c6f76478 100644 --- a/linux/microblaze/syscallent.h +++ b/linux/microblaze/syscallent.h @@ -331,7 +331,7 @@ [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, [324] = { 6, TD, SEN(fallocate), "fallocate" }, -[325] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[325] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [326] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, [327] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, [328] = { 4, TI, SEN(semctl), "semctl" }, diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index 31fd1af1..d3b8bbbe 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -222,7 +222,7 @@ [6212] = { 3, TD, SEN(fcntl64), "fcntl64" }, [6213] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [6214] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[6215] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[6215] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [6216] = { 4, TD, SEN(fadvise64_64), "fadvise64" }, [6217] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, [6218] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index f63ed0e1..353d9601 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -221,7 +221,7 @@ [5211] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [5212] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [5213] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[5214] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[5214] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [5215] = { 4, TD, SEN(fadvise64), "fadvise64" }, [5216] = { 3, 0, SEN(timer_create), "timer_create" }, [5217] = { 4, 0, SEN(timer_settime), "timer_settime" }, diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h index 9f9c0af6..b1ed72c6 100644 --- a/linux/powerpc64/syscallent.h +++ b/linux/powerpc64/syscallent.h @@ -381,7 +381,7 @@ [387] = { 4, 0, SEN(rseq), "rseq" }, [388] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, /* room for arch specific syscalls */ -[392] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [393] = { 3, TI, SEN(semget), "semget" }, [394] = { 4, TI, SEN(semctl), "semctl" }, [395] = { 3, TI, SEN(shmget), "shmget" }, diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index db695cfe..1e897112 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -381,7 +381,7 @@ [385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [386] = { 1, 0, SEN(pkey_free), "pkey_free" }, /* room for arch specific calls */ -[392] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [393] = { 3, TI, SEN(semget), "semget" }, [394] = { 4, TI, SEN(semctl), "semctl" }, [395] = { 3, TI, SEN(shmget), "shmget" }, diff --git a/linux/sparc64/syscallent.h b/linux/sparc64/syscallent.h index d276fb63..a6947a8b 100644 --- a/linux/sparc64/syscallent.h +++ b/linux/sparc64/syscallent.h @@ -370,7 +370,7 @@ [364] = { 1, 0, SEN(pkey_free), "pkey_free" }, [365] = { 4, 0, SEN(rseq), "rseq" }, /* room for arch specific calls */ -[392] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [393] = { 3, TI, SEN(semget), "semget" }, [394] = { 4, TI, SEN(semctl), "semctl" }, [395] = { 3, TI, SEN(shmget), "shmget" }, diff --git a/linux/subcall32.h b/linux/subcall32.h index 84781af3..4331faa8 100644 --- a/linux/subcall32.h +++ b/linux/subcall32.h @@ -1 +1,3 @@ +#define sys_semtimedop sys_semtimedop_time32 #include "subcall.h" +#undef sys_semtimedop diff --git a/linux/subcall64.h b/linux/subcall64.h index 84781af3..fea7e60d 100644 --- a/linux/subcall64.h +++ b/linux/subcall64.h @@ -1 +1,3 @@ +#define sys_semtimedop sys_semtimedop_time64 #include "subcall.h" +#undef sys_semtimedop diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h index 1a1b3761..994d80b9 100644 --- a/linux/x32/syscallent.h +++ b/linux/x32/syscallent.h @@ -225,7 +225,7 @@ [217] = { 3, TD, SEN(getdents64), "getdents64" }, [218] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [219] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[220] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[220] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [221] = { 4, TD, SEN(fadvise64), "fadvise64" }, [222] = { 3, 0, SEN(printargs), "timer_create#64" }, [223] = { 4, 0, SEN(timer_settime), "timer_settime" }, diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h index e46d500f..5852498d 100644 --- a/linux/x86_64/syscallent.h +++ b/linux/x86_64/syscallent.h @@ -225,7 +225,7 @@ [217] = { 3, TD, SEN(getdents64), "getdents64" }, [218] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [219] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[220] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[220] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [221] = { 4, TD, SEN(fadvise64), "fadvise64" }, [222] = { 3, 0, SEN(timer_create), "timer_create" }, [223] = { 4, 0, SEN(timer_settime), "timer_settime" }, diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index 9a096725..de2f508b 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -160,7 +160,7 @@ [158] = { 2, 0, SEN(capget), "capget" }, [159] = { 2, 0, SEN(capset), "capset" }, [160] = { 4, 0, SEN(ptrace), "ptrace" }, -[161] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[161] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [162] = { 3, TI, SEN(semget), "semget" }, [163] = { 3, TI, SEN(semop), "semop" }, [164] = { 4, TI, SEN(semctl), "semctl" }, -- 2.40.0