This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Add x32 support to sys/procfs.h
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 16 May 2012 06:13:56 -0700
- Subject: PATCH: Add x32 support to sys/procfs.h
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch adds x32 support to sys/procfs.h. Tested on Linux/x86-64.
OK to install?
H.J.
---
* sysdeps/unix/sysv/linux/x86_64/sys/procfs.h (elf_greg_t): Use
"unsigned long long int" if __x86_64__ is defined.
(elf_fpregset_t): Check __x86_64__ instead of __WORDSIZE.
diff --git a/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h b/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
index bfb7d8c..c907d35 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sys/procfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2004, 2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -35,7 +35,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
@@ -44,7 +48,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;