From b6645f105be49754a0f8ca17b48afb417f705ab1 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 futex syscall * futex.c (SYS_FUNC(futex)): Remove. [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(futex_time32)): New function. * linux/64/syscallent.h: Replace SEN(futex) with SEN(futex_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/sh64/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(futex) with SEN(futex_time32). * linux/arm/syscallent.h: Likewise. * linux/avr32/syscallent.h: Likewise. * linux/bfin/syscallent.h: Likewise. * linux/hppa/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/mips/syscallent-n32.h: Likewise. * linux/mips/syscallent-o32.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/xtensa/syscallent.h: Likewise. --- futex.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/i386/syscallent.h | 2 +- linux/ia64/syscallent.h | 2 +- linux/m68k/syscallent.h | 2 +- linux/microblaze/syscallent.h | 2 +- linux/mips/syscallent-n32.h | 2 +- linux/mips/syscallent-n64.h | 2 +- linux/mips/syscallent-o32.h | 2 +- linux/powerpc/syscallent.h | 2 +- linux/powerpc64/syscallent.h | 2 +- linux/s390/syscallent.h | 2 +- linux/s390x/syscallent.h | 2 +- linux/sh/syscallent.h | 2 +- linux/sh64/syscallent.h | 2 +- linux/sparc/syscallent.h | 2 +- linux/sparc64/syscallent.h | 2 +- linux/x32/syscallent.h | 2 +- linux/x86_64/syscallent.h | 2 +- linux/xtensa/syscallent.h | 2 +- 26 files changed, 29 insertions(+), 27 deletions(-) diff --git a/futex.c b/futex.c index b9048bc0..71de714f 100644 --- a/futex.c +++ b/futex.c @@ -123,10 +123,12 @@ do_futex(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) return RVAL_DECODED; } -SYS_FUNC(futex) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(futex_time32) { - return do_futex(tcp, print_timespec); + return do_futex(tcp, print_timespec32); } +#endif SYS_FUNC(futex_time64) { diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h index 6251730b..9ee22822 100644 --- a/linux/32/syscallent.h +++ b/linux/32/syscallent.h @@ -110,7 +110,7 @@ [ 95] = { 5, TP, SEN(waitid), "waitid" }, [ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [ 97] = { 1, TP, SEN(unshare), "unshare" }, -[ 98] = { 6, 0, SEN(futex), "futex" }, +[ 98] = { 6, 0, SEN(futex_time32), "futex" }, [ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [100] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, [101] = { 2, 0, SEN(nanosleep), "nanosleep" }, diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h index 4c59344f..6106a95b 100644 --- a/linux/64/syscallent.h +++ b/linux/64/syscallent.h @@ -103,7 +103,7 @@ [ 95] = { 5, TP, SEN(waitid), "waitid" }, [ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [ 97] = { 1, TP, SEN(unshare), "unshare" }, -[ 98] = { 6, 0, SEN(futex), "futex" }, +[ 98] = { 6, 0, SEN(futex_time64), "futex" }, [ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [100] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, [101] = { 2, 0, SEN(nanosleep), "nanosleep" }, diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index 3db6b35b..d001a97a 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -338,7 +338,7 @@ [391] = { 2, TF, SEN(removexattr), "removexattr" }, [392] = { 2, TF, SEN(removexattr), "lremovexattr" }, [393] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[394] = { 6, 0, SEN(futex), "futex" }, +[394] = { 6, 0, SEN(futex_time64), "futex" }, [395] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [396] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [397] = { 5, 0, SEN(tuxcall), "tuxcall" }, /* not implemented */ diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index 43b52e12..df6cd6e4 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -247,7 +247,7 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 2, TM, SEN(io_setup), "io_setup" }, diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h index 1c1bda65..30082d69 100644 --- a/linux/avr32/syscallent.h +++ b/linux/avr32/syscallent.h @@ -198,7 +198,7 @@ [189] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [190] = { 2, TS, SEN(kill), "tkill" }, [191] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[192] = { 6, 0, SEN(futex), "futex" }, +[192] = { 6, 0, SEN(futex_time32), "futex" }, [193] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [194] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [195] = { 2, 0, SEN(capget), "capget" }, diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h index fe75eb83..21fe89bd 100644 --- a/linux/bfin/syscallent.h +++ b/linux/bfin/syscallent.h @@ -246,7 +246,7 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h index bfc83aec..ebbceaa2 100644 --- a/linux/hppa/syscallent.h +++ b/linux/hppa/syscallent.h @@ -213,7 +213,7 @@ [207] = { 4, TD, SEN(readahead), "readahead" }, [208] = { 2, TS, SEN(kill), "tkill" }, [209] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[210] = { 6, 0, SEN(futex), "futex" }, +[210] = { 6, 0, SEN(futex_time32), "futex" }, [211] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [212] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [213] = { 5, 0, SEN(printargs), "set_thread_area" }, diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h index 0ce8e36b..6e81662e 100644 --- a/linux/i386/syscallent.h +++ b/linux/i386/syscallent.h @@ -246,7 +246,7 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index ec62fb17..f86a4c05 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -213,7 +213,7 @@ [1024 + 203] = { 2, TF, SEN(removexattr), "lremovexattr" }, [1024 + 204] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [1024 + 205] = { 2, TS, SEN(kill), "tkill" }, -[1024 + 206] = { 6, 0, SEN(futex), "futex" }, +[1024 + 206] = { 6, 0, SEN(futex_time64), "futex" }, [1024 + 207] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [1024 + 208] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [1024 + 209] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index 779fb402..d27aa9dc 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -241,7 +241,7 @@ [232] = { 2, TF, SEN(removexattr), "removexattr" }, [233] = { 2, TF, SEN(removexattr), "lremovexattr" }, [234] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[235] = { 6, 0, SEN(futex), "futex" }, +[235] = { 6, 0, SEN(futex_time32), "futex" }, [236] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [237] = { 3, TM, SEN(mincore), "mincore" }, [238] = { 3, TM, SEN(madvise), "madvise" }, diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h index a325646a..7e9eaa64 100644 --- a/linux/microblaze/syscallent.h +++ b/linux/microblaze/syscallent.h @@ -246,7 +246,7 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index e5d7d9c7..3849dbd6 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -201,7 +201,7 @@ [6191] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [6192] = { 2, TS, SEN(kill), "tkill" }, [6193] = { 1, 0, SEN(time), "time" }, -[6194] = { 6, 0, SEN(futex), "futex" }, +[6194] = { 6, 0, SEN(futex_time32), "futex" }, [6195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [6196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [6197] = { 3, 0, SEN(printargs), "cacheflush" }, diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index 1b1b4079..c5c72892 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -201,7 +201,7 @@ [5191] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [5192] = { 2, TS, SEN(kill), "tkill" }, [5193] = { 1, 0, SEN(time), "time" }, -[5194] = { 6, 0, SEN(futex), "futex" }, +[5194] = { 6, 0, SEN(futex_time64), "futex" }, [5195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [5196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [5197] = { 3, 0, SEN(printargs), "cacheflush" }, diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index c4aa51ca..5eb06ac3 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -246,7 +246,7 @@ [4235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [4236] = { 2, TS, SEN(kill), "tkill" }, [4237] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[4238] = { 6, 0, SEN(futex), "futex" }, +[4238] = { 6, 0, SEN(futex_time32), "futex" }, [4239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [4240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [4241] = { 2, TM, SEN(io_setup), "io_setup" }, diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index af7f412a..82620c0f 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -228,7 +228,7 @@ [218] = { 2, TF, SEN(removexattr), "removexattr" }, [219] = { 2, TF, SEN(removexattr), "lremovexattr" }, [220] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[221] = { 6, 0, SEN(futex), "futex" }, +[221] = { 6, 0, SEN(futex_time32), "futex" }, [222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [224] = { }, diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h index 2dd1fa87..90177a14 100644 --- a/linux/powerpc64/syscallent.h +++ b/linux/powerpc64/syscallent.h @@ -223,7 +223,7 @@ [218] = { 2, TF, SEN(removexattr), "removexattr" }, [219] = { 2, TF, SEN(removexattr), "lremovexattr" }, [220] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[221] = { 6, 0, SEN(futex), "futex" }, +[221] = { 6, 0, SEN(futex_time64), "futex" }, [222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [224] = { }, diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index 12e1035c..bdcdbcb2 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -247,7 +247,7 @@ [235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [236] = { 0, PU|NF, SEN(gettid), "gettid" }, [237] = { 2, TS, SEN(kill), "tkill" }, -[238] = { 6, 0, SEN(futex), "futex" }, +[238] = { 6, 0, SEN(futex_time32), "futex" }, [239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [241] = { 3, TS, SEN(tgkill), "tgkill" }, diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index 75949439..aee9252c 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -231,7 +231,7 @@ [235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [236] = { 0, PU|NF, SEN(gettid), "gettid" }, [237] = { 2, TS, SEN(kill), "tkill" }, -[238] = { 6, 0, SEN(futex), "futex" }, +[238] = { 6, 0, SEN(futex_time64), "futex" }, [239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [241] = { 3, TS, SEN(tgkill), "tgkill" }, diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h index 2274fd00..bcb12223 100644 --- a/linux/sh/syscallent.h +++ b/linux/sh/syscallent.h @@ -247,7 +247,7 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243 ... 244] = { }, diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index 9d4fd507..3efc3b52 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -273,7 +273,7 @@ [265] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [266] = { 2, TS, SEN(kill), "tkill" }, [267] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[268] = { 6, 0, SEN(futex), "futex" }, +[268] = { 6, 0, SEN(futex_time64), "futex" }, [269] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [270] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [271 ... 272] = { }, diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index d2c51e8c..359824d9 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -147,7 +147,7 @@ [139] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, [140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [141] = { 3, TN, SEN(getpeername), "getpeername" }, -[142] = { 6, 0, SEN(futex), "futex" }, +[142] = { 6, 0, SEN(futex_time32), "futex" }, [143] = { 0, PU|NF, SEN(gettid), "gettid" }, [144] = { 2, 0, SEN(getrlimit), "getrlimit" }, [145] = { 2, 0, SEN(setrlimit), "setrlimit" }, diff --git a/linux/sparc64/syscallent.h b/linux/sparc64/syscallent.h index c292cab4..42c47af2 100644 --- a/linux/sparc64/syscallent.h +++ b/linux/sparc64/syscallent.h @@ -145,7 +145,7 @@ [139] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, [140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [141] = { 3, TN, SEN(getpeername), "getpeername" }, -[142] = { 6, 0, SEN(futex), "futex" }, +[142] = { 6, 0, SEN(futex_time64), "futex" }, [143] = { 0, PU|NF, SEN(gettid), "gettid" }, [144] = { 2, 0, SEN(getrlimit), "getrlimit" }, [145] = { 2, 0, SEN(setrlimit), "setrlimit" }, diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h index 7c21aa33..1a1b3761 100644 --- a/linux/x32/syscallent.h +++ b/linux/x32/syscallent.h @@ -207,7 +207,7 @@ [199] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [200] = { 2, TS, SEN(kill), "tkill" }, [201] = { 1, 0, SEN(time), "time" }, -[202] = { 6, 0, SEN(futex), "futex" }, +[202] = { 6, 0, SEN(futex_time64), "futex" }, [203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [205] = { 1, 0, SEN(printargs), "set_thread_area#64" }, diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h index c738ab2f..e46d500f 100644 --- a/linux/x86_64/syscallent.h +++ b/linux/x86_64/syscallent.h @@ -207,7 +207,7 @@ [199] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [200] = { 2, TS, SEN(kill), "tkill" }, [201] = { 1, 0, SEN(time), "time" }, -[202] = { 6, 0, SEN(futex), "futex" }, +[202] = { 6, 0, SEN(futex_time64), "futex" }, [203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [205] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index a5dac2c3..9a096725 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -190,7 +190,7 @@ [188] = { 2, 0, SEN(setrlimit), "setrlimit" }, [189] = { 2, 0, SEN(getrlimit), "getrlimit" }, [190] = { 2, 0, SEN(getrusage), "getrusage" }, -[191] = { 6, 0, SEN(futex), "futex" }, +[191] = { 6, 0, SEN(futex_time32), "futex" }, [192] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, [193] = { 2, 0, SEN(settimeofday), "settimeofday" }, [194] = { 1, 0, SEN(adjtimex32), "adjtimex" }, -- 2.40.0