about summary refs log tree commit diff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-09-06 23:17:53 -0400
committerUlrich Drepper <drepper@gmail.com>2011-09-06 23:17:53 -0400
commita0e1f41bd487d2202b6c1e0802c0e6c91630fbea (patch)
tree67aec34b0c299450ff5e1190d8b0c524a9b7aa5e /nptl/sysdeps
parentceaa0c5dc3f86d3d3126abdd592a3c4fdc457255 (diff)
downloadglibc-a0e1f41bd487d2202b6c1e0802c0e6c91630fbea.tar.gz
glibc-a0e1f41bd487d2202b6c1e0802c0e6c91630fbea.tar.xz
glibc-a0e1f41bd487d2202b6c1e0802c0e6c91630fbea.zip
Don't call gettimeofday vsyscall in x86-64 sem_timedwait
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S13
1 files changed, 5 insertions, 8 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index ca49cb89d0..2926b36e7b 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2009,2010,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -24,10 +24,6 @@
 #include <pthread-errnos.h>
 #include <structsem.h>
 
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
-
 	.text
 
 	.globl	sem_timedwait
@@ -212,9 +208,10 @@ sem_timedwait:
 	addq	$1, NWAITERS(%r12)
 
 7:	xorl	%esi, %esi
-	movq	%rsp, %rdi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	movq	%rsp,%rdi
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	8(%rsp), %rax