summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2018-01-20 00:02:57 +0000
committerDmitry V. Levin <ldv@altlinux.org>2018-01-21 01:46:04 +0000
commita9b7fb4f732258f16baa3ac1a56a78b440ca00e7 (patch)
treea8b15b1c459e7688c8d4fdac6ffb6ff897f08856
parent11540211f558c95e800ad7b26894e38b3a08ea12 (diff)
downloadstrace-a9b7fb4f732258f16baa3ac1a56a78b440ca00e7.tar.gz
Replace HAVE_GETRVAL2 with HAVE_ARCH_GETRVAL2
* linux/arch_defs_.h [!HAVE_ARCH_GETRVAL2] (HAVE_ARCH_GETRVAL2): New macro. * linux/alpha/arch_defs_.h: New file. * linux/ia64/arch_defs_.h: Likewise. * linux/mips/arch_defs_.h: Likewise. * linux/sh/arch_defs_.h: Likewise. * linux/sparc/arch_defs_.h: Likewise. * linux/sparc64/arch_defs_.h: Likewise. * Makefile.am (EXTRA_DIST): Add them. * defs.h (HAVE_GETRVAL2): Remove. (getrval2): Check for HAVE_ARCH_GETRVAL2 instead of arch checks. * net.c (SYS_FUNC(pipe)): Check for HAVE_ARCH_GETRVAL2 instead of HAVE_GETRVAL2. * syscall.c: Likewise.
-rw-r--r--Makefile.am6
-rw-r--r--defs.h6
-rw-r--r--linux/alpha/arch_defs_.h1
-rw-r--r--linux/arch_defs_.h4
-rw-r--r--linux/ia64/arch_defs_.h1
-rw-r--r--linux/mips/arch_defs_.h1
-rw-r--r--linux/sh/arch_defs_.h1
-rw-r--r--linux/sparc/arch_defs_.h1
-rw-r--r--linux/sparc64/arch_defs_.h1
-rw-r--r--net.c2
-rw-r--r--syscall.c2
11 files changed, 19 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 510a1e2bf..ef7e8ed8a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -405,6 +405,7 @@ EXTRA_DIST = \
linux/aarch64/signalent1.h \
linux/aarch64/syscallent.h \
linux/aarch64/syscallent1.h \
+ linux/alpha/arch_defs_.h \
linux/alpha/arch_getrval2.c \
linux/alpha/arch_regs.c \
linux/alpha/arch_regs.h \
@@ -535,6 +536,7 @@ EXTRA_DIST = \
linux/i386/syscallent.h \
linux/i386/userent.h \
linux/i386/userent0.h \
+ linux/ia64/arch_defs_.h \
linux/ia64/arch_getrval2.c \
linux/ia64/arch_regs.c \
linux/ia64/arch_regs.h \
@@ -589,6 +591,7 @@ EXTRA_DIST = \
linux/microblaze/set_scno.c \
linux/microblaze/syscallent.h \
linux/microblaze/userent.h \
+ linux/mips/arch_defs_.h \
linux/mips/arch_getrval2.c \
linux/mips/arch_regs.c \
linux/mips/arch_regs.h \
@@ -728,6 +731,7 @@ EXTRA_DIST = \
linux/s390x/syscallent.h \
linux/s390x/syscallent1.h \
linux/s390x/userent.h \
+ linux/sh/arch_defs_.h \
linux/sh/arch_getrval2.c \
linux/sh/arch_regs.c \
linux/sh/arch_rt_sigframe.c \
@@ -759,6 +763,7 @@ EXTRA_DIST = \
linux/signalent.h \
linux/smc_diag.h \
linux/sock_diag.h \
+ linux/sparc/arch_defs_.h \
linux/sparc/arch_getrval2.c \
linux/sparc/arch_regs.c \
linux/sparc/arch_regs.h \
@@ -777,6 +782,7 @@ EXTRA_DIST = \
linux/sparc/signalent.h \
linux/sparc/syscallent.h \
linux/sparc/userent.h \
+ linux/sparc64/arch_defs_.h \
linux/sparc64/arch_getrval2.c \
linux/sparc64/arch_regs.c \
linux/sparc64/arch_regs.h \
diff --git a/defs.h b/defs.h
index 41c8f60f9..0753dda38 100644
--- a/defs.h
+++ b/defs.h
@@ -479,12 +479,8 @@ print_array(struct tcb *,
void *opaque_data),
void *opaque_data);
-#if defined ALPHA || defined IA64 || defined MIPS \
- || defined SH || defined SPARC || defined SPARC64
-# define HAVE_GETRVAL2
+#if HAVE_ARCH_GETRVAL2
extern long getrval2(struct tcb *);
-#else
-# undef HAVE_GETRVAL2
#endif
extern const char *signame(const int);
diff --git a/linux/alpha/arch_defs_.h b/linux/alpha/arch_defs_.h
new file mode 100644
index 000000000..491f19c52
--- /dev/null
+++ b/linux/alpha/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_GETRVAL2 1
diff --git a/linux/arch_defs_.h b/linux/arch_defs_.h
index c08694d21..1c754820d 100644
--- a/linux/arch_defs_.h
+++ b/linux/arch_defs_.h
@@ -1,5 +1,9 @@
/* Fallback file for arch-specific definitions. */
+#ifndef HAVE_ARCH_GETRVAL2
+# define HAVE_ARCH_GETRVAL2 0
+#endif
+
#ifndef HAVE_ARCH_OLD_MMAP
# define HAVE_ARCH_OLD_MMAP 0
#endif
diff --git a/linux/ia64/arch_defs_.h b/linux/ia64/arch_defs_.h
new file mode 100644
index 000000000..491f19c52
--- /dev/null
+++ b/linux/ia64/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_GETRVAL2 1
diff --git a/linux/mips/arch_defs_.h b/linux/mips/arch_defs_.h
new file mode 100644
index 000000000..491f19c52
--- /dev/null
+++ b/linux/mips/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_GETRVAL2 1
diff --git a/linux/sh/arch_defs_.h b/linux/sh/arch_defs_.h
new file mode 100644
index 000000000..491f19c52
--- /dev/null
+++ b/linux/sh/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_GETRVAL2 1
diff --git a/linux/sparc/arch_defs_.h b/linux/sparc/arch_defs_.h
new file mode 100644
index 000000000..491f19c52
--- /dev/null
+++ b/linux/sparc/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_GETRVAL2 1
diff --git a/linux/sparc64/arch_defs_.h b/linux/sparc64/arch_defs_.h
new file mode 100644
index 000000000..491f19c52
--- /dev/null
+++ b/linux/sparc64/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_GETRVAL2 1
diff --git a/net.c b/net.c
index 498a6384a..044bcf64e 100644
--- a/net.c
+++ b/net.c
@@ -354,7 +354,7 @@ do_pipe(struct tcb *tcp, int flags_arg)
SYS_FUNC(pipe)
{
-#ifdef HAVE_GETRVAL2
+#if HAVE_ARCH_GETRVAL2
if (exiting(tcp) && !syserror(tcp))
printpair_fd(tcp, tcp->u_rval, getrval2(tcp));
return 0;
diff --git a/syscall.c b/syscall.c
index 1a45b977c..6fb111e90 100644
--- a/syscall.c
+++ b/syscall.c
@@ -1012,7 +1012,7 @@ restore_cleared_syserror(struct tcb *tcp)
#include "arch_regs.c"
-#ifdef HAVE_GETRVAL2
+#if HAVE_ARCH_GETRVAL2
# include "arch_getrval2.c"
#endif