Move regs-related macros and declarations from defs.h to regs.h
* regs.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/arch_regs.h: New file.
* linux/alpha/arch_regs.h: Likewise.
* linux/arm/arch_regs.h: Likewise.
* linux/hppa/arch_regs.h: Likewise.
* linux/i386/arch_regs.h: Likewise.
* linux/ia64/arch_regs.h: Likewise.
* linux/mips/arch_regs.h: Likewise.
* linux/powerpc/arch_regs.h: Likewise.
* linux/sh64/arch_regs.h: Likewise.
* linux/sparc/arch_regs.h: Likewise.
* linux/sparc64/arch_regs.h: Likewise.
* linux/tile/arch_regs.h: Likewise.
* linux/x86_64/arch_regs.h: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
* defs.h: Remove definitions of PTRACE_*, REG_*, PT_*, U_REG_*,
and ARM_* macros.
Remove declarations of struct pt_regs variables.
[SPARC]: Do not include <asm/psr.h>.
[SPARC64]: Do not include <asm/psrcompat.h>.
* bjm.c: Do not include <sys/user.h>.
* process.c: Include "regs.h".
Do not include <sys/user.h> and <sys/reg.h>.
[IA64]: Do not include <asm/ptrace_offsets.h> and <asm/rse.h>.
* util.c: Likewise.
* syscall.c: Likewise.
[AARCH64]: Define struct arm_pt_regs and ARM_* macros.
[SPARC]: Include <asm/psr.h>.
[SPARC64]: Include <asm/psrcompat.h>.
* signal.c: Include "regs.h".
Do not include <sys/user.h> and <sys/reg.h>.
[IA64]: Do not include <asm/ptrace_offsets.h>.
* strace.c [IA64]: Do not include <asm/ptrace_offsets.h>.
diff --git a/syscall.c b/syscall.c
index adc1785..e2b1626 100644
--- a/syscall.c
+++ b/syscall.c
@@ -32,11 +32,13 @@
*/
#include "defs.h"
-#include <sys/user.h>
#include <sys/param.h>
-#ifdef HAVE_SYS_REG_H
-# include <sys/reg.h>
+/* for struct iovec */
+#include <sys/uio.h>
+/* for NT_PRSTATUS */
+#ifdef HAVE_ELF_H
+# include <elf.h>
#endif
#include "ptrace.h"
@@ -48,16 +50,12 @@
# define PTRACE_SETREGS PTRACE_SETREGS64
#endif
-#if defined(IA64)
-# include <asm/ptrace_offsets.h>
-# include <asm/rse.h>
-#endif
+#include "regs.h"
-/* for struct iovec */
-#include <sys/uio.h>
-/* for NT_PRSTATUS */
-#ifdef HAVE_ELF_H
-# include <elf.h>
+#if defined SPARC64
+# include <asm/psrcompat.h>
+#elif defined SPARC
+# include <asm/psr.h>
#endif
#ifndef NSIG
@@ -715,6 +713,27 @@
struct pt_regs arm_regs; /* not static */
# define ARCH_REGS_FOR_GETREGSET arm_regs
#elif defined(AARCH64)
+struct arm_pt_regs {
+ int uregs[18];
+};
+# define ARM_cpsr uregs[16]
+# define ARM_pc uregs[15]
+# define ARM_lr uregs[14]
+# define ARM_sp uregs[13]
+# define ARM_ip uregs[12]
+# define ARM_fp uregs[11]
+# define ARM_r10 uregs[10]
+# define ARM_r9 uregs[9]
+# define ARM_r8 uregs[8]
+# define ARM_r7 uregs[7]
+# define ARM_r6 uregs[6]
+# define ARM_r5 uregs[5]
+# define ARM_r4 uregs[4]
+# define ARM_r3 uregs[3]
+# define ARM_r2 uregs[2]
+# define ARM_r1 uregs[1]
+# define ARM_r0 uregs[0]
+# define ARM_ORIG_r0 uregs[17]
static union {
struct user_pt_regs aarch64_r;
struct arm_pt_regs arm_r;