* Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
* Copyright (c) 2005-2007 Roland McGrath <roland@redhat.com>
* Copyright (c) 2008-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2014-2017 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
unsigned int i;
for (i = first; i < tcp->s_ent->nargs; ++i)
- tprintf(", %#" PRI_klx, getarg_klu(tcp, i));
+ tprintf(", %#" PRI_klx, tcp->u_arg[i]);
}
SYS_FUNC(prctl)
{
const unsigned int option = tcp->u_arg[0];
- const kernel_ulong_t arg2 = getarg_klu(tcp, 1);
- const kernel_ulong_t arg3 = getarg_klu(tcp, 2);
+ const kernel_ulong_t arg2 = tcp->u_arg[1];
+ const kernel_ulong_t arg3 = tcp->u_arg[2];
/*
* PR_SET_VMA is the only command which actually uses these arguments
* currently, and it is available only on Android for now.
*/
#ifdef __ANDROID__
- const kernel_ulong_t arg4 = getarg_klu(tcp, 3);
- const kernel_ulong_t arg5 = getarg_klu(tcp, 4);
+ const kernel_ulong_t arg4 = tcp->u_arg[3];
+ const kernel_ulong_t arg5 = tcp->u_arg[4];
#endif
unsigned int i;
break;
if (syserror(tcp))
return 0;
- tcp->auxstr = xlookup(pr_dumpable, (kernel_ureg_t) tcp->u_rval);
+ tcp->auxstr = xlookup(pr_dumpable, (kernel_ulong_t) tcp->u_rval);
return RVAL_STR;
case PR_GET_NAME:
if (syserror(tcp) || tcp->u_rval == 0)
return 0;
tcp->auxstr = sprintflags("", secbits,
- (kernel_ureg_t) tcp->u_rval);
+ (kernel_ulong_t) tcp->u_rval);
return RVAL_STR;
case PR_GET_TID_ADDRESS:
if (entering(tcp))
tprints(", ");
else
- printnum_ptr(tcp, arg2);
+ printnum_kptr(tcp, arg2);
break;
case PR_GET_TSC:
if (syserror(tcp) || tcp->u_rval == 0)
return 0;
tcp->auxstr = sprintflags("", pr_fp_mode,
- (kernel_ureg_t) tcp->u_rval);
+ (kernel_ulong_t) tcp->u_rval);
return RVAL_STR;
/* PR_TASK_PERF_EVENTS_* take no arguments. */
return RVAL_DECODED;
if (SECCOMP_MODE_FILTER == arg2) {
tprints(", ");
- print_seccomp_filter(tcp, arg3);
+ decode_seccomp_fprog(tcp, arg3);
return RVAL_DECODED;
}
print_prctl_args(tcp, 2);
if (syserror(tcp))
return 0;
tcp->auxstr = xlookup(pr_mce_kill_policy,
- (kernel_ureg_t) tcp->u_rval);
+ (kernel_ulong_t) tcp->u_rval);
return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL;
case PR_SET_FP_MODE:
return 0;
}
-#if defined X86_64 || defined X32
-# include <asm/prctl.h>
+#if defined X86_64 || defined X32 || defined I386
# include "xlat/archvals.h"
SYS_FUNC(arch_prctl)
{
const unsigned int option = tcp->u_arg[0];
- const kernel_ulong_t addr = getarg_klu(tcp, 1);
+ const kernel_ulong_t addr = tcp->u_arg[1];
if (entering(tcp))
printxval(archvals, option, "ARCH_???");
tprintf(", %#" PRI_klx, addr);
return RVAL_DECODED;
}
-#endif /* X86_64 || X32 */
+#endif /* X86_64 || X32 || I386 */