• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <asm/rse.h>
2 
3 /* Return -1 on error or 1 on success (never 0!). */
4 static int
get_syscall_args(struct tcb * tcp)5 get_syscall_args(struct tcb *tcp)
6 {
7 	unsigned long *rbs_end =
8 		(unsigned long *) ia64_regs.ar[PT_AUR_BSP];
9 	unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f;
10 	unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f;
11 	unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
12 	unsigned int i;
13 
14 	for (i = 0; i < tcp->s_ent->nargs; ++i) {
15 		if (umove(tcp,
16 			  (unsigned long) ia64_rse_skip_regs(out0, i),
17 			  &tcp->u_arg[i]) < 0) {
18 			if (errno == EPERM)
19 				tcp->u_arg[i] = 0;
20 			else
21 				return -1;
22 		}
23 	}
24 
25 	return 1;
26 }
27