1 /* Return -1 on error or 1 on success (never 0!). */ 2 static int get_syscall_args(struct tcb * tcp)3get_syscall_args(struct tcb *tcp) 4 { 5 #if defined LINUX_MIPSN64 6 tcp->u_arg[0] = mips_REG_A0; 7 tcp->u_arg[1] = mips_REG_A1; 8 tcp->u_arg[2] = mips_REG_A2; 9 tcp->u_arg[3] = mips_REG_A3; 10 tcp->u_arg[4] = mips_REG_A4; 11 tcp->u_arg[5] = mips_REG_A5; 12 #elif defined LINUX_MIPSN32 13 tcp->u_arg[0] = tcp->ext_arg[0] = mips_REG_A0; 14 tcp->u_arg[1] = tcp->ext_arg[1] = mips_REG_A1; 15 tcp->u_arg[2] = tcp->ext_arg[2] = mips_REG_A2; 16 tcp->u_arg[3] = tcp->ext_arg[3] = mips_REG_A3; 17 tcp->u_arg[4] = tcp->ext_arg[4] = mips_REG_A4; 18 tcp->u_arg[5] = tcp->ext_arg[5] = mips_REG_A5; 19 #elif defined LINUX_MIPSO32 20 tcp->u_arg[0] = mips_REG_A0; 21 tcp->u_arg[1] = mips_REG_A1; 22 tcp->u_arg[2] = mips_REG_A2; 23 tcp->u_arg[3] = mips_REG_A3; 24 if (tcp->s_ent->nargs > 4) { 25 if (umoven(tcp, mips_REG_SP + 4 * 4, 26 (tcp->s_ent->nargs - 4) * sizeof(tcp->u_arg[0]), 27 &tcp->u_arg[4]) < 0) 28 return -1; 29 } 30 #else 31 # error unsupported mips abi 32 #endif 33 return 1; 34 } 35