Home | History | Annotate | Download | only in mips
      1 /* Return -1 on error or 1 on success (never 0!). */
      2 static int
      3 get_syscall_args(struct tcb *tcp)
      4 {
      5 #if defined LINUX_MIPSN64 || defined LINUX_MIPSN32
      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_MIPSO32
     13 	tcp->u_arg[0] = mips_REG_A0;
     14 	tcp->u_arg[1] = mips_REG_A1;
     15 	tcp->u_arg[2] = mips_REG_A2;
     16 	tcp->u_arg[3] = mips_REG_A3;
     17 	if (tcp->s_ent->nargs > 4) {
     18 		if (umoven(tcp, mips_REG_SP + 4 * 4,
     19 			   (tcp->s_ent->nargs - 4) * sizeof(tcp->u_arg[0]),
     20 			   &tcp->u_arg[4]) < 0)
     21 			return -1;
     22 	}
     23 #else
     24 # error unsupported mips abi
     25 #endif
     26 	return 1;
     27 }
     28