summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-06-03 16:04:11 +0000
committerUlrich Drepper <drepper@redhat.com>2004-06-03 16:04:11 +0000
commit75fcceded2cfc65e4879521fff4db6a620a96363 (patch)
tree6d0763c5a2e4b59ece4d57a87232d435d15a5f7f /nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
parent322861e8b62dbca030a66f9ab37e6688b223c65f (diff)
Update.
2004-06-03 Ulrich Drepper <drepper@redhat.com> * sysdeps/i386/i486/bits/atomic.h: Optimize a bit.
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.S16
1 files changed, 10 insertions, 6 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 80cbf7e430..e75f05e07f 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
@@ -105,6 +105,7 @@ __pthread_cond_timedwait:
movq 8(%rsp), %rdi
incq total_seq(%rdi)
+ incl cond_futex(%rdi)
/* Install cancellation handler. */
#ifdef PIC
@@ -118,9 +119,9 @@ __pthread_cond_timedwait:
/* Get and store current wakeup_seq value. */
movq 8(%rsp), %rdi
- movq wakeup_seq(%rdi), %r12
+ movq wakeup_seq(%rdi), %r9
movl broadcast_seq(%rdi), %edx
- movq %r12, 40(%rsp)
+ movq %r9, 40(%rsp)
movl %edx, 4(%rsp)
/* Get the current time. */
@@ -172,6 +173,8 @@ __pthread_cond_timedwait:
21: movq %rcx, 24(%rsp)
movq %rdx, 32(%rsp)
+ movl cond_futex(%rdi), %r12d
+
/* Unlock. */
LOCK
#if cond_lock == 0
@@ -187,7 +190,7 @@ __pthread_cond_timedwait:
leaq 24(%rsp), %r10
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
movq %r12, %rdx
- addq $wakeup_seq-cond_lock, %rdi
+ addq $cond_futex, %rdi
movq $SYS_futex, %rax
syscall
movq %rax, %r14
@@ -211,21 +214,22 @@ __pthread_cond_timedwait:
movq woken_seq(%rdi), %rax
- movq wakeup_seq(%rdi), %r12
+ movq wakeup_seq(%rdi), %r9
cmpl 4(%rsp), %edx
jne 23f
- cmpq 40(%rsp), %r12
+ cmpq 40(%rsp), %r9
jbe 15f
- cmpq %rax, %r12
+ cmpq %rax, %r9
ja 9f
15: cmpq $-ETIMEDOUT, %r14
jne 8b
13: incq wakeup_seq(%rdi)
+ incl cond_futex(%rdi)
movq $ETIMEDOUT, %r14
jmp 14f