Home | History | Annotate | Download | only in ia64
      1 /* Return -1 on error or 1 on success (never 0!). */
      2 static int
      3 get_syscall_args(struct tcb *tcp)
      4 {
      5 	if (!ia64_ia32mode) {
      6 		unsigned long *rbs_end =
      7 			(unsigned long *) ia64_regs.ar[PT_AUR_BSP];
      8 		unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f;
      9 		unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f;
     10 		unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
     11 		unsigned int i;
     12 
     13 		for (i = 0; i < tcp->s_ent->nargs; ++i) {
     14 			if (umoven(tcp,
     15 				   (unsigned long) ia64_rse_skip_regs(out0, i),
     16 				   sizeof(long), &tcp->u_arg[i]) < 0)
     17 				return -1;
     18 		}
     19 	} else {
     20 		/* truncate away IVE sign-extension */
     21 		tcp->u_arg[0] = 0xffffffff & ia64_regs.gr[11]; /* EBX */
     22 		tcp->u_arg[1] = 0xffffffff & ia64_regs.gr[ 9]; /* ECX */
     23 		tcp->u_arg[2] = 0xffffffff & ia64_regs.gr[10]; /* EDX */
     24 		tcp->u_arg[3] = 0xffffffff & ia64_regs.gr[14]; /* ESI */
     25 		tcp->u_arg[4] = 0xffffffff & ia64_regs.gr[15]; /* EDI */
     26 		tcp->u_arg[5] = 0xffffffff & ia64_regs.gr[13]; /* EBP */
     27 	}
     28 	return 1;
     29 }
     30