summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-22 12:01:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-05-22 12:01:39 -0700
commitdc7322443eb8806290a6f4b4f5a9dfc3388b9318 (patch)
tree8dedcdf24bcb3a1e7e82e2f50e6d0b3e61e713bd /sysdeps
parentd9990eacdf5ab4dbb54fef1ba1e3b67c6112ccc7 (diff)
downloadglibc-dc7322443eb8806290a6f4b4f5a9dfc3388b9318.tar.gz
Update x32 arch_prctl.c
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c b/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
index 44c100b9a4..6933306de9 100644
--- a/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch_prctl.c
@@ -21,28 +21,27 @@
#include <sys/syscall.h>
#include <sysdep.h>
-/* Since x32 arch_prctl stores 32-bit base address of segment register %fs
- and %gs as unsigned 64-bit value via ARCH_GET_FS and ARCH_GET_GS, we
- use a local unsigned 64-bit variable to hold the base address and copy
- it to ADDR after arch_prctl return. */
+/* Since x32 arch_prctl stores 32-bit base address of segment registers
+ %fs and %gs as unsigned 64-bit value via ARCH_GET_FS and ARCH_GET_GS,
+ we use an unsigned 64-bit variable to hold the base address and copy
+ it to ADDR after the system call returns. */
int
__arch_prctl (int code, uintptr_t *addr)
{
int res;
uint64_t addr64;
- uintptr_t *addr_saved;
+ void *prctl_arg = addr;
switch (code)
{
case ARCH_GET_FS:
case ARCH_GET_GS:
- addr_saved = addr;
- addr = (uintptr_t *) &addr64;
+ prctl_arg = &addr64;
break;
}
- res = INLINE_SYSCALL (arch_prctl, 2, code, addr);
+ res = INLINE_SYSCALL (arch_prctl, 2, code, prctl_arg);
if (res == 0)
switch (code)
{
@@ -54,11 +53,10 @@ __arch_prctl (int code, uintptr_t *addr)
__set_errno (EOVERFLOW);
return -1;
}
- *addr_saved = (uintptr_t) addr64;
+ *addr = (uintptr_t) addr64;
break;
}
return res;
}
-
weak_alias (__arch_prctl, arch_prctl)