]> granicus.if.org Git - strace/commitdiff
Use the same type for i386_regs on 32-bit and 64-bit x86.
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 15 Feb 2013 20:04:28 +0000 (21:04 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 15 Feb 2013 20:04:28 +0000 (21:04 +0100)
* defs.h: Stop including <asm/ptrace.h> for x86.
Change i386_regs from "struct pt_regs" to "struct user_regs_struct".
* syscall.c: Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
defs.h
syscall.c

diff --git a/defs.h b/defs.h
index c607dfd707dfd1b73bb14011362616924a344f10..f92d025bf75e2755ab774bd208c40053d99483ee 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -154,6 +154,10 @@ extern char *stpcpy(char *dst, const char *src);
 extern long ptrace(int, int, char *, long);
 #endif
 
+#if defined(TILE)
+# include <asm/ptrace.h>  /* struct pt_regs */
+#endif
+
 #if !HAVE_DECL_PTRACE_SETOPTIONS
 # define PTRACE_SETOPTIONS     0x4200
 #endif
@@ -218,12 +222,6 @@ extern long ptrace(int, int, char *, long);
 # define PTRACE_EVENT_STOP     128
 #endif
 
-#if defined(X86_64) || defined(X32) || defined(I386) || defined(TILE)
-/* For struct pt_regs. x86 strace uses PTRACE_GETREGS.
- * PTRACE_GETREGS returns registers in the layout of this struct.
- */
-# include <asm/ptrace.h>
-#endif
 #ifdef ALPHA
 # define REG_R0 0
 # define REG_A0 16
@@ -356,7 +354,7 @@ struct arm_pt_regs {
 #endif
 
 #if defined(I386)
-extern struct pt_regs i386_regs;
+extern struct user_regs_struct i386_regs;
 #endif
 #if defined(IA64)
 extern long ia32;
index bf94eee5e5abf7edfa759cddb7d34a9f5116b71a..26c84deb905ec706fd9d3f0633a49317521f438e 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -67,7 +67,6 @@
 
 #if defined(X86_64) || defined(X32)
 # include <linux/ptrace.h>
-# include <asm/ptrace.h>
 # include <sys/uio.h>
 # include <elf.h>
 #endif
@@ -672,7 +671,7 @@ is_restart_error(struct tcb *tcp)
 }
 
 #if defined(I386)
-struct pt_regs i386_regs;
+struct user_regs_struct i386_regs;
 #elif defined(X86_64) || defined(X32)
 /*
  * On i386, pt_regs and user_regs_struct are the same,