blob: 3970df8f73dfe6f7d1ae3efc245457e9c985d764 [file] [log] [blame]
Dmitry V. Levin64672a62015-11-30 00:57:14 +00001/* Return -1 on error or 1 on success (never 0!). */
2static int
3get_syscall_args(struct tcb *tcp)
4{
5 /* Registers used by SH5 Linux system calls for parameters */
6 static const int syscall_regs[MAX_ARGS] = { 2, 3, 4, 5, 6, 7 };
7 unsigned int i;
Dmitry V. Levind70d1c42015-03-22 22:13:55 +00008
Dmitry V. Levin64672a62015-11-30 00:57:14 +00009 for (i = 0; i < tcp->s_ent->nargs; ++i)
10 if (upeek(tcp->pid, REG_GENERAL(syscall_regs[i]),
11 &tcp->u_arg[i]) < 0)
12 return -1;
13 return 1;
14}