]> granicus.if.org Git - strace/commitdiff
2003-01-20 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Mon, 20 Jan 2003 09:04:36 +0000 (09:04 +0000)
committerRoland McGrath <roland@redhat.com>
Mon, 20 Jan 2003 09:04:36 +0000 (09:04 +0000)
* util.c (restore_arg0): Evaluate args in no-op defns.
* util.c [S390 || S390X] (arg0_offset, arg1_offset): Fix definitions
for clone call on S390.  From Michael Holzheu <holzheu@de.ibm.com>.

util.c

diff --git a/util.c b/util.c
index 32f8d098f3439adc9462788ce9f3e394d744e1b1..7b6262062993ac459167e149e3ee31e5c6d571c8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1195,17 +1195,21 @@ typedef struct regs arg_setup_state;
 #else
 
 # if defined S390 || defined S390X
-#  define arg0_offset  PT_ORIGGPR2
-#  define arg1_offset  PT_GPR2
-#  define restore_arg0(tcp, state, val) 0
-#  define restore_arg1(tcp, state, val) 0
+/* Note: this is only true for the `clone' system call, which handles
+   arguments specially.  We could as well say that its first two arguments
+   are swapped relative to other architectures, but that would just be
+   another #ifdef in the calls.  */
+#  define arg0_offset  PT_GPR3
+#  define arg1_offset  PT_ORIGGPR2
+#  define restore_arg0(tcp, state, val) ((void) (state), 0)
+#  define restore_arg1(tcp, state, val) ((void) (state), 0)
 # elif defined (ALPHA) || defined (MIPS)
 #  define arg0_offset  REG_A0
 #  define arg1_offset  (REG_A0+1)
 # elif defined (POWERPC)
 #  define arg0_offset  (sizeof(unsigned long)*PT_R3)
 #  define arg1_offset  (sizeof(unsigned long)*PT_R4)
-#  define restore_arg0(tcp, state, val) 0
+#  define restore_arg0(tcp, state, val) ((void) (state), 0)
 # elif defined (HPPA)
 #  define arg0_offset   PT_GR26
 #  define arg1_offset   (PT_GR26-4)