From a14c918ddd41c66bc2163ee6c17bdc77bd1e67de Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 30 May 2003 17:49:37 +0000 Subject: (__lll_mutex_lock_wait): Replace one memory operation with one register operation. --- nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'nptl/sysdeps/unix/sysv/linux/x86_64') diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S index 1b2731a29e..2a2f847684 100644 --- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S +++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S @@ -46,22 +46,24 @@ __lll_mutex_lock_wait: pushq %r10 pushq %rdx + /* In the loop we are going to add 2 instead of 1 which is what + the caller did. Account for that. */ + decq %rsi + xorq %r10, %r10 /* No timeout. */ 1: - leaq 1(%rsi), %rdx /* account for the preceeded xadd. */ + leaq 2(%rsi), %rdx /* account for the preceeded xadd. */ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */ movq $SYS_futex, %rax syscall - movl $1, %esi + movl $2, %esi LOCK xaddl %esi, (%rdi) testl %esi, %esi jne 1b - movl $2, (%rdi) - popq %rdx popq %r10 retq -- cgit 1.4.1