1 #ifndef HAVE_GETREGS_OLD 2 # define arch_set_error i386_set_error 3 # define arch_set_success i386_set_success 4 # include "i386/set_error.c" 5 # undef arch_set_success 6 # undef arch_set_error 7 #endif /* !HAVE_GETREGS_OLD */ 8 9 static int arch_set_error(struct tcb * tcp)10arch_set_error(struct tcb *tcp) 11 { 12 #ifdef HAVE_GETREGS_OLD 13 x86_64_regs.rax = - (long long) tcp->u_error; 14 return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax); 15 #else 16 if (x86_io.iov_len == sizeof(i386_regs)) 17 return i386_set_error(tcp); 18 19 x86_64_regs.rax = - (long long) tcp->u_error; 20 return set_regs(tcp->pid); 21 #endif 22 } 23 24 static int arch_set_success(struct tcb * tcp)25arch_set_success(struct tcb *tcp) 26 { 27 #ifdef HAVE_GETREGS_OLD 28 x86_64_regs.rax = (long long) tcp->u_rval; 29 return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax); 30 #else 31 if (x86_io.iov_len == sizeof(i386_regs)) 32 return i386_set_success(tcp); 33 34 x86_64_regs.rax = (long long) tcp->u_rval; 35 return set_regs(tcp->pid); 36 #endif 37 } 38