-/* ia64 does not return the input arguments from functions (and syscalls)
- according to ia64 RSE (Register Stack Engine) behavior. */
-
-# define restore_arg0(tcp, state, val) ((void) (state), 0)
-# define restore_arg1(tcp, state, val) ((void) (state), 0)
-
-#elif defined(SPARC) || defined(SPARC64)
-
-# if defined(SPARC64)
-# undef PTRACE_GETREGS
-# define PTRACE_GETREGS PTRACE_GETREGS64
-# undef PTRACE_SETREGS
-# define PTRACE_SETREGS PTRACE_SETREGS64
-# endif
-
-typedef struct pt_regs arg_setup_state;
-
-# define arg_setup(tcp, state) \
- (ptrace(PTRACE_GETREGS, (tcp)->pid, (char *) (state), 0))
-# define arg_finish_change(tcp, state) \
- (ptrace(PTRACE_SETREGS, (tcp)->pid, (char *) (state), 0))
-
-# define get_arg0(tcp, state, valp) (*(valp) = (state)->u_regs[U_REG_O0], 0)
-# define get_arg1(tcp, state, valp) (*(valp) = (state)->u_regs[U_REG_O1], 0)
-# define set_arg0(tcp, state, val) ((state)->u_regs[U_REG_O0] = (val), 0)
-# define set_arg1(tcp, state, val) ((state)->u_regs[U_REG_O1] = (val), 0)
-# define restore_arg0(tcp, state, val) 0
-
-#else /* other architectures */
-
-# if defined S390 || defined S390X
-/* 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)
-# define arg0_index 1
-# define arg1_index 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) ((void) (state), 0)
-# elif defined(HPPA)
-# define arg0_offset PT_GR26
-# define arg1_offset (PT_GR26-4)
-# elif defined(X86_64) || defined(X32)
-# define arg0_offset ((long)(8*(current_personality ? RBX : RDI)))
-# define arg1_offset ((long)(8*(current_personality ? RCX : RSI)))
-# elif defined(SH)
-# define arg0_offset (4*(REG_REG0+4))
-# define arg1_offset (4*(REG_REG0+5))
-# elif defined(SH64)
- /* ABI defines arg0 & 1 in r2 & r3 */
-# define arg0_offset (REG_OFFSET+16)
-# define arg1_offset (REG_OFFSET+24)
-# define restore_arg0(tcp, state, val) 0
-# elif defined CRISV10 || defined CRISV32
-# define arg0_offset (4*PT_R11)
-# define arg1_offset (4*PT_ORIG_R10)
-# define restore_arg0(tcp, state, val) 0
-# define restore_arg1(tcp, state, val) 0
-# define arg0_index 1
-# define arg1_index 0
-# else
-# define arg0_offset 0
-# define arg1_offset 4
-# if defined ARM
-# define restore_arg0(tcp, state, val) 0
-# endif
-# endif
-
-typedef int arg_setup_state;
-
-# define arg_setup(tcp, state) (0)
-# define arg_finish_change(tcp, state) 0
-# define get_arg0(tcp, cookie, valp) (upeek((tcp)->pid, arg0_offset, (valp)))
-# define get_arg1(tcp, cookie, valp) (upeek((tcp)->pid, arg1_offset, (valp)))
-
-static int
-set_arg0(struct tcb *tcp, void *cookie, long val)