* linux/aarch64/nr_prefix.c: New file.
* linux/arm/nr_prefix.c: Likewise.
* linux/nr_prefix.c: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
* printsiginfo.c: Include nr_prefix.c
(print_si_info): Use nr_prefix.
linux/aarch64/ioctls_arch1.h \
linux/aarch64/ioctls_inc0.h \
linux/aarch64/ioctls_inc1.h \
+ linux/aarch64/nr_prefix.c \
linux/aarch64/set_error.c \
linux/aarch64/set_scno.c \
linux/aarch64/shuffle_scno.c \
linux/arm/get_syscall_args.c \
linux/arm/ioctls_arch0.h \
linux/arm/ioctls_inc0.h \
+ linux/arm/nr_prefix.c \
linux/arm/set_error.c \
linux/arm/set_scno.c \
linux/arm/shuffle_scno.c \
linux/nios2/set_error.c \
linux/nios2/set_scno.c \
linux/nios2/syscallent.h \
+ linux/nr_prefix.c \
linux/or1k/arch_regs.c \
linux/or1k/arch_regs.h \
linux/or1k/arch_rt_sigframe.c \
--- /dev/null
+#include "../arm/nr_prefix.c"
--- /dev/null
+static inline const char *
+nr_prefix(kernel_ulong_t scno)
+{
+ /*
+ * For now, the set of syscalls that are shuffled is equivalent to the
+ * set of syscalls that have __ARM_NR_ prefix.
+ */
+ if (shuffle_scno(scno) != scno)
+ return "__ARM_NR_";
+ else
+ return "__NR_";
+}
--- /dev/null
+/**
+ * Returns prefix for a syscall constant literal. It is has to be that way
+ * thanks to ARM that decided to prefix their special system calls like sys32
+ * and sys26 with __ARM_NR_* prefix instead of __NR_*, so we can't simply print
+ * "__NR_".
+ */
+static inline const char *
+nr_prefix(kernel_ulong_t scno)
+{
+ return "__NR_";
+}
#include MPERS_DEFS
+#include "nr_prefix.c"
+
#ifndef IN_MPERS
#include "printsiginfo.h"
#endif
printaddr(ptr_to_kulong(sip->si_call_addr));
tprints(", si_syscall=");
if (scname)
- tprintf("__NR_%s", scname);
+ tprintf("%s%s",
+ nr_prefix(sip->si_syscall), scname);
else
tprintf("%u", (unsigned) sip->si_syscall);
tprints(", si_arch=");