From: Dmitry V. Levin Date: Tue, 7 May 2013 14:38:01 +0000 (+0400) Subject: Move subcall decoding configuration out of the common code X-Git-Tag: v4.8~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=de462cf99b2826a564f026cf79b631a1e10dad85;p=strace Move subcall decoding configuration out of the common code * Makefile.am (EXTRA_DIST): Add linux/subcall.h. * linux/syscall.h (SYS_socket_subcall): Remove. (SYS_socket_nsubcalls, SYS_ipc_subcall, SYS_ipc_nsubcalls): Move to ... * linux/subcall.h: ... new file. * linux/arm/syscallent.h: Define SYS_socket_subcall, include subcall.h. * linux/i386/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/powerpc/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/s390x/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. Suggested by Mike Frysinger and Chris Metcalf. --- diff --git a/Makefile.am b/Makefile.am index 639430d4..99d9eaf5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -151,6 +151,7 @@ EXTRA_DIST = \ linux/sparc64/syscallent.h \ linux/sparc64/syscallent1.h \ linux/sparc64/syscallent2.h \ + linux/subcall.h \ linux/syscall.h \ linux/tile/ioctlent.h.in \ linux/tile/syscallent.h \ diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index b1fd3708..8976a82c 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -431,9 +431,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ -# if SYS_socket_subcall != 400 -# error fix me -# endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h index 8a1d6179..7e40f32d 100644 --- a/linux/i386/syscallent.h +++ b/linux/i386/syscallent.h @@ -428,10 +428,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index b872a090..222a5220 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -426,10 +426,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index 8db525dd..ada58f74 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -426,10 +426,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index c68362ec..8faeba6e 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -428,10 +428,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index 05b296cf..1b19a41f 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -427,10 +427,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h index 577a4f65..af069629 100644 --- a/linux/sh/syscallent.h +++ b/linux/sh/syscallent.h @@ -430,10 +430,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index 246417dc..fa9c0aa3 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -426,10 +426,8 @@ { 5, 0, NULL, NULL }, /* 397 */ { 5, 0, NULL, NULL }, /* 398 */ { 5, 0, NULL, NULL }, /* 399 */ - -#if SYS_socket_subcall != 400 - #error fix me -#endif +#define SYS_socket_subcall 400 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 400 */ { 3, TN, sys_socket, "socket" }, /* 401 */ { 3, TN, sys_bind, "bind" }, /* 402 */ diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index de464807..dc000964 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -351,9 +351,8 @@ { 5, 0, NULL, NULL }, /* 350 */ { 5, 0, NULL, NULL }, /* 351 */ { 5, 0, NULL, NULL }, /* 352 */ -#if SYS_socket_subcall != 353 - #error fix me -#endif +#define SYS_socket_subcall 353 +#include "subcall.h" { 6, 0, printargs, "socket_subcall"}, /* 353 */ { 3, TN, sys_socket, "socket" }, /* 354 */ { 3, TN, sys_bind, "bind" }, /* 355 */ diff --git a/linux/subcall.h b/linux/subcall.h new file mode 100644 index 00000000..54f7fcaf --- /dev/null +++ b/linux/subcall.h @@ -0,0 +1,6 @@ +#ifndef SYS_socket_subcall +# error SYS_socket_subcall is not defined +#endif +#define SYS_socket_nsubcalls 20 +#define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls)) +#define SYS_ipc_nsubcalls 25 diff --git a/linux/syscall.h b/linux/syscall.h index 0c87fa67..f6afcac0 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -313,30 +313,6 @@ int sys_osf_utimes(); int sys_osf_wait4(); #endif -#if defined ALPHA \ - || defined __ARM_EABI__ \ - || defined BFIN \ - || defined HPPA \ - || defined METAG \ - || defined MIPS \ - || defined TILE \ - || defined XTENSA -/* - * This architecture does not have a socketcall or ipc subcall, - * it has dedicated syscalls instead, so there is no need - * to implement socket or ipc subcall decoding. - */ -#else -# if defined SPARC || defined SPARC64 -# define SYS_socket_subcall 353 -# else -# define SYS_socket_subcall 400 -# endif -# define SYS_socket_nsubcalls 20 -# define SYS_ipc_subcall ((SYS_socket_subcall)+(SYS_socket_nsubcalls)) -# define SYS_ipc_nsubcalls 25 -#endif - #if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64) int sys_getpagesize(); #endif