about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-09-07 00:14:06 -0400
committerUlrich Drepper <drepper@gmail.com>2011-09-07 00:14:06 -0400
commit9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e (patch)
treecc1249b28b4a809ce87d788c0ea23e6b5b8b5475 /nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
parente38ba7ab6a56d53bde4fcff250f6928fb473bc3c (diff)
downloadglibc-9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e.tar.gz
glibc-9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e.tar.xz
glibc-9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e.zip
Remove gettimeofday vsyscall use from x86-86 libpthread
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S21
1 files changed, 9 insertions, 12 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 48ea8b967e..d11b29746a 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -26,9 +26,6 @@
 
 #include <kernel-features.h>
 
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
-
 
 	.text
 
@@ -453,13 +450,11 @@ __pthread_cond_timedwait:
 	movq	__vdso_clock_gettime@GOTPCREL(%rip), %rax
 	movq	(%rax), %rax
 	PTR_DEMANGLE (%rax)
-	jz	26f
 	call	*%rax
-	jmp	27f
-#  endif
-26:	movl	$__NR_clock_gettime, %eax
+#  else
+	movl	$__NR_clock_gettime, %eax
 	syscall
-27:
+#  endif
 #  ifndef __ASSUME_POSIX_TIMERS
 	cmpq	$-ENOSYS, %rax
 	je	19f
@@ -473,8 +468,9 @@ __pthread_cond_timedwait:
 # else
 	leaq	24(%rsp), %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	40(%rsp), %rax
@@ -611,8 +607,9 @@ __pthread_cond_timedwait:
 	/* clock_gettime not available.  */
 19:	leaq	32(%rsp), %rdi
 	xorl	%esi, %esi
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-	callq	*%rax
+	/* This call works because we directly jump to a system call entry
+	   which preserves all the registers.  */
+	call	JUMPTARGET(__gettimeofday)
 
 	/* Compute relative timeout.  */
 	movq	40(%rsp), %rax