about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.x3236
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h11
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/procfs.h6
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/reg.h3
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h13
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sys/user.h82
7 files changed, 101 insertions, 55 deletions
diff --git a/ChangeLog.x32 b/ChangeLog.x32
index 3bc91f7c07..6d068152d6 100644
--- a/ChangeLog.x32
+++ b/ChangeLog.x32
@@ -1,5 +1,41 @@
 2011-11-21  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h: Include
+	<stdint.h>.
+	(GET_PC): Cast to uintptr_t first.
+	(GET_FRAME): Likewise.
+	(GET_STACK): Likewise.
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h: Don't include
+	<bits/wordsize.h>.  Check __x86_64__ instead of __WORDSIZE.
+	(DR_CONTROL_RESERVED): Use ULL instead of UL suffix.
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/procfs.h (elf_greg_t): Use
+	"unsigned long long int" if __x86_64__ is defined.
+	Check __x86_64__ instead of __WORDSIZE.
+	(elf_prstatus): Use "unsigned long long int" instead of
+	"unsigned long int" if __x86_64__ is defined.
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/reg.h: Don't
+	include <bits/wordsize.h>.  Check __x86_64__ instead of
+	__WORDSIZE.
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h: Don't
+	include <bits/wordsize.h>.  Check __x86_64__ instead of
+	__WORDSIZE.
+	(greg_t): Use "long long int" if __x86_64__ is defined.
+	(mcontext_t): Replace "unsigned long" with "unsigned long long".
+	(ucontext_t): Likewise.
+
+	* sysdeps/unix/sysv/linux/x86_64/sys/user.h: Don't
+	include <bits/wordsize.h>.  Check __x86_64__ instead of
+	__WORDSIZE.
+	(user_regs_struct): Use "unsigned long long" instead of
+	"unsigned long" if __x86_64__ is defined.
+	(user): Likewise.  Pad if __LP64__ isn't defined.
+
+2011-11-21  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* sysdeps/unix/sysv/linux/x86_64/sys/msg.h: New.
 
 2011-11-21  H.J. Lu  <hongjiu.lu@intel.com>
diff --git a/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h b/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
index 11493c580b..78c9aa7a03 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h
@@ -16,11 +16,16 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <stdint.h>
+
 #define SIGCONTEXT siginfo_t *_si, struct ucontext *
 #define SIGCONTEXT_EXTRA_ARGS _si,
-#define GET_PC(ctx)	((void *) (ctx)->uc_mcontext.gregs[REG_RIP])
-#define GET_FRAME(ctx)	((void *) (ctx)->uc_mcontext.gregs[REG_RBP])
-#define GET_STACK(ctx)	((void *) (ctx)->uc_mcontext.gregs[REG_RSP])
+#define GET_PC(ctx)	\
+  ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RIP])
+#define GET_FRAME(ctx)	\
+  ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RBP])
+#define GET_STACK(ctx)	\
+  ((void *) (uintptr_t) (ctx)->uc_mcontext.gregs[REG_RSP])
 
 #define CALL_SIGHANDLER(handler, signo, ctx) \
   (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h b/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
index 8abbf7546f..c3adbdf0d9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/debugreg.h
@@ -18,7 +18,6 @@
 
 #ifndef _SYS_DEBUGREG_H
 #define _SYS_DEBUGREG_H	1
-#include <bits/wordsize.h>
 
 /* Indicate the register numbers for a number of the specific
    debug registers.  Registers 0-3 contain the addresses we wish to trap on */
@@ -77,8 +76,8 @@
 
 
 
-#if __WORDSIZE == 64
-# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */
+#ifdef __x86_64__
+# define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00ULL) /* Reserved */
 #else
 # define DR_CONTROL_RESERVED (0x00FC00U) /* Reserved */
 #endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h b/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
index 853d7db49d..80c6cfb9bf 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
@@ -36,7 +36,11 @@
 __BEGIN_DECLS
 
 /* Type for a general-purpose register.  */
+#ifdef __x86_64__
+typedef unsigned long long elf_greg_t;
+#else
 typedef unsigned long elf_greg_t;
+#endif
 
 /* And the whole bunch of them.  We could have used `struct
    user_regs_struct' directly in the typedef, but tradition says that
@@ -45,7 +49,7 @@ typedef unsigned long elf_greg_t;
 #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
-#if __WORDSIZE == 32
+#ifndef __x86_64__
 /* Register set for the floating-point registers.  */
 typedef struct user_fpregs_struct elf_fpregset_t;
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/reg.h b/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
index acb71a2bc5..0772bc7bf5 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/reg.h
@@ -18,10 +18,9 @@
 
 #ifndef _SYS_REG_H
 #define _SYS_REG_H	1
-#include <bits/wordsize.h>
 
 
-#if __WORDSIZE == 64
+#ifdef __x86_64__
 /* Index into an array of 8 byte longs returned from ptrace for
    location of the users' stored general purpose registers.  */
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h b/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
index b59cd292f9..5bc8f0efdd 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/ucontext.h
@@ -21,16 +21,15 @@
 
 #include <features.h>
 #include <signal.h>
-#include <bits/wordsize.h>
 
 /* We need the signal context definitions even if they are not used
    included in <signal.h>.  */
 #include <bits/sigcontext.h>
 
-#if __WORDSIZE == 64
+#ifdef __x86_64__
 
 /* Type for general register.  */
-typedef long int greg_t;
+typedef long long int greg_t;
 
 /* Number of general registers.  */
 #define NGREG	23
@@ -128,13 +127,13 @@ typedef struct
     gregset_t gregs;
     /* Note that fpregs is a pointer.  */
     fpregset_t fpregs;
-    unsigned long __reserved1 [8];
+    unsigned long long __reserved1 [8];
 } mcontext_t;
 
 /* Userlevel context.  */
 typedef struct ucontext
   {
-    unsigned long int uc_flags;
+    unsigned long long int uc_flags;
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
@@ -142,7 +141,7 @@ typedef struct ucontext
     struct _libc_fpstate __fpregs_mem;
   } ucontext_t;
 
-#else /* __WORDSIZE == 32 */
+#else /* !__x86_64__ */
 
 /* Type for general register.  */
 typedef int greg_t;
@@ -243,6 +242,6 @@ typedef struct ucontext
     struct _libc_fpstate __fpregs_mem;
   } ucontext_t;
 
-#endif /* __WORDSIZE == 32 */
+#endif /* !__x86_64__ */
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/user.h b/sysdeps/unix/sysv/linux/x86_64/sys/user.h
index ceadcf4788..9cdd380afe 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/user.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/user.h
@@ -23,9 +23,7 @@
    too much into it.  Don't use it for anything other than GDB unless
    you know what you are doing.  */
 
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
+#ifdef __x86_64__
 
 struct user_fpregs_struct
 {
@@ -44,33 +42,33 @@ struct user_fpregs_struct
 
 struct user_regs_struct
 {
-  unsigned long r15;
-  unsigned long r14;
-  unsigned long r13;
-  unsigned long r12;
-  unsigned long rbp;
-  unsigned long rbx;
-  unsigned long r11;
-  unsigned long r10;
-  unsigned long r9;
-  unsigned long r8;
-  unsigned long rax;
-  unsigned long rcx;
-  unsigned long rdx;
-  unsigned long rsi;
-  unsigned long rdi;
-  unsigned long orig_rax;
-  unsigned long rip;
-  unsigned long cs;
-  unsigned long eflags;
-  unsigned long rsp;
-  unsigned long ss;
-  unsigned long fs_base;
-  unsigned long gs_base;
-  unsigned long ds;
-  unsigned long es;
-  unsigned long fs;
-  unsigned long gs;
+  unsigned long long int r15;
+  unsigned long long int r14;
+  unsigned long long int r13;
+  unsigned long long int r12;
+  unsigned long long int rbp;
+  unsigned long long int rbx;
+  unsigned long long int r11;
+  unsigned long long int r10;
+  unsigned long long int r9;
+  unsigned long long int r8;
+  unsigned long long int rax;
+  unsigned long long int rcx;
+  unsigned long long int rdx;
+  unsigned long long int rsi;
+  unsigned long long int rdi;
+  unsigned long long int orig_rax;
+  unsigned long long int rip;
+  unsigned long long int cs;
+  unsigned long long int eflags;
+  unsigned long long int rsp;
+  unsigned long long int ss;
+  unsigned long long int fs_base;
+  unsigned long long int gs_base;
+  unsigned long long int ds;
+  unsigned long long int es;
+  unsigned long long int fs;
+  unsigned long long int gs;
 };
 
 struct user
@@ -78,18 +76,24 @@ struct user
   struct user_regs_struct	regs;
   int				u_fpvalid;
   struct user_fpregs_struct	i387;
-  unsigned long int		u_tsize;
-  unsigned long int		u_dsize;
-  unsigned long int		u_ssize;
-  unsigned long			start_code;
-  unsigned long			start_stack;
-  long int			signal;
+  unsigned long long int	u_tsize;
+  unsigned long long int	u_dsize;
+  unsigned long long int	u_ssize;
+  unsigned long long int	start_code;
+  unsigned long long int	start_stack;
+  long long int			signal;
   int				reserved;
   struct user_regs_struct*	u_ar0;
+#ifndef __LP64__
+  unsigned int			pad0;
+#endif
   struct user_fpregs_struct*	u_fpstate;
-  unsigned long int		magic;
+#ifndef __LP64__
+  unsigned int			pad1;
+#endif
+  unsigned long long int	magic;
   char				u_comm [32];
-  unsigned long int		u_debugreg [8];
+  unsigned long long int	u_debugreg [8];
 };
 
 #else
@@ -162,7 +166,7 @@ struct user
   char				u_comm [32];
   int				u_debugreg [8];
 };
-#endif  /* __WORDSIZE */
+#endif  /* __x86_64__ */
 
 #define PAGE_SHIFT		12
 #define PAGE_SIZE		(1UL << PAGE_SHIFT)