Dmitry V. Levin
64672a6526
Make get_syscall_args.c files more self-contained. While they are still being included by syscall.c, the latter no longer defines get_syscall_args function. * linux/aarch64/get_syscall_args.c: Include "arm/get_syscall_args.c" with get_syscall_args temporarily defined to arm_get_syscall_args. (get_syscall_args): Define. * linux/alpha/get_syscall_args.c (get_syscall_args): Define. * linux/arc/get_syscall_args.c: Likewise. * linux/arm/get_syscall_args.c: Likewise. * linux/avr32/get_syscall_args.c: Likewise. * linux/bfin/get_syscall_args.c: Likewise. * linux/crisv10/get_syscall_args.c: Likewise. * linux/hppa/get_syscall_args.c: Likewise. * linux/i386/get_syscall_args.c: Likewise. * linux/ia64/get_syscall_args.c: Likewise. * linux/m68k/get_syscall_args.c: Likewise. * linux/metag/get_syscall_args.c: Likewise. * linux/microblaze/get_syscall_args.c: Likewise. * linux/mips/get_syscall_args.c: Likewise. * linux/nios2/get_syscall_args.c: Likewise. * linux/or1k/get_syscall_args.c: Likewise. * linux/powerpc/get_syscall_args.c: Likewise. * linux/s390/get_syscall_args.c: Likewise. * linux/sh/get_syscall_args.c: Likewise. * linux/sh64/get_syscall_args.c: Likewise. * linux/sparc/get_syscall_args.c: Likewise. * linux/tile/get_syscall_args.c: Likewise. * linux/x86_64/get_syscall_args.c: Likewise. * linux/xtensa/get_syscall_args.c: Likewise. * syscall.c (get_syscall_args): Remove. Include "get_syscall_args.c" in file scope. Requested-by: Denys Vlasenko <dvlasenk@redhat.com>
20 lines
414 B
C
20 lines
414 B
C
/* Return -1 on error or 1 on success (never 0!). */
|
|
static int
|
|
get_syscall_args(struct tcb *tcp)
|
|
{
|
|
static const int syscall_regs[MAX_ARGS] = {
|
|
4 * (REG_REG0+4),
|
|
4 * (REG_REG0+5),
|
|
4 * (REG_REG0+6),
|
|
4 * (REG_REG0+7),
|
|
4 * (REG_REG0 ),
|
|
4 * (REG_REG0+1)
|
|
};
|
|
unsigned int i;
|
|
|
|
for (i = 0; i < tcp->s_ent->nargs; ++i)
|
|
if (upeek(tcp->pid, syscall_regs[i], &tcp->u_arg[i]) < 0)
|
|
return -1;
|
|
return 1;
|
|
}
|