[PATCH] Move subcall decoding configuration out of the common code
Dmitry V. Levin
ldv at altlinux.org
Tue May 7 15:38:26 UTC 2013
On Tue, May 07, 2013 at 09:30:45AM -0400, Mike Frysinger wrote:
> On Tuesday 07 May 2013 08:14:46 Chris Metcalf wrote:
> > On 5/6/2013 7:43 PM, Dmitry V. Levin wrote:
> > > On Mon, May 06, 2013 at 03:21:38PM -0700, Chris Zankel wrote:
> > >> The Xtensa architecture also used dedicated syscalls and doesn't
> > >> need to multiplex ipc and socket subcalls.
> > >
> > > Applied, thanks.
> >
> > No new architecture will ever use the subcall model, so in fact it's
> > probably cleaner to just list the ones that do use it.
>
> yeah, i was thinking it might be better to move those ifdefs out of the common
> code and just declare it in the relevant syscallent.h header
Yes, something like this?
Makefile.am | 1 +
linux/arm/syscallent.h | 1 +
linux/i386/syscallent.h | 1 +
linux/m68k/syscallent.h | 1 +
linux/powerpc/syscallent.h | 1 +
linux/s390/syscallent.h | 1 +
linux/s390x/syscallent.h | 1 +
linux/sh/syscallent.h | 1 +
linux/sh64/syscallent.h | 1 +
linux/sparc/syscallent.h | 2 ++
linux/subcall.h | 6 ++++++
linux/syscall.h | 24 ------------------------
12 files changed, 17 insertions(+), 24 deletions(-)
create mode 100644 linux/subcall.h
diff --git a/Makefile.am b/Makefile.am
index 639430d..99d9eaf 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 b1fd370..8979654 100644
--- a/linux/arm/syscallent.h
+++ b/linux/arm/syscallent.h
@@ -431,6 +431,7 @@
{ 5, 0, NULL, NULL }, /* 397 */
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
# if SYS_socket_subcall != 400
# error fix me
# endif
diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h
index 8a1d617..fd94af9 100644
--- a/linux/i386/syscallent.h
+++ b/linux/i386/syscallent.h
@@ -429,6 +429,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h
index b872a09..944982e 100644
--- a/linux/m68k/syscallent.h
+++ b/linux/m68k/syscallent.h
@@ -427,6 +427,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h
index 8db525d..b75837f 100644
--- a/linux/powerpc/syscallent.h
+++ b/linux/powerpc/syscallent.h
@@ -427,6 +427,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index c68362e..375697c 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -429,6 +429,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index 05b296c..2df168b 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -428,6 +428,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h
index 577a4f6..c98ad94 100644
--- a/linux/sh/syscallent.h
+++ b/linux/sh/syscallent.h
@@ -431,6 +431,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h
index 246417d..0a129eb 100644
--- a/linux/sh64/syscallent.h
+++ b/linux/sh64/syscallent.h
@@ -427,6 +427,7 @@
{ 5, 0, NULL, NULL }, /* 398 */
{ 5, 0, NULL, NULL }, /* 399 */
+#include "subcall.h"
#if SYS_socket_subcall != 400
#error fix me
#endif
diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h
index de46480..dfc687a 100644
--- a/linux/sparc/syscallent.h
+++ b/linux/sparc/syscallent.h
@@ -351,6 +351,8 @@
{ 5, 0, NULL, NULL }, /* 350 */
{ 5, 0, NULL, NULL }, /* 351 */
{ 5, 0, NULL, NULL }, /* 352 */
+#define SYS_socket_subcall 353
+#include "subcall.h"
#if SYS_socket_subcall != 353
#error fix me
#endif
diff --git a/linux/subcall.h b/linux/subcall.h
new file mode 100644
index 0000000..ff4dd97
--- /dev/null
+++ b/linux/subcall.h
@@ -0,0 +1,6 @@
+#ifndef SYS_socket_subcall
+# 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
diff --git a/linux/syscall.h b/linux/syscall.h
index 0c87fa6..f6afcac 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
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130507/2db8ab36/attachment.bin>
More information about the Strace-devel
mailing list