about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-09-21 07:40:24 +0000
committerUlrich Drepper <drepper@redhat.com>2003-09-21 07:40:24 +0000
commit71451de2f1245b21ce3ba407068c453a866c03d6 (patch)
tree6646149e32cd4e762f758fa4796a62aab0ea8adf /nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
parent56a4aa9886dc1145f8feac66b66216a44cb092c1 (diff)
downloadglibc-71451de2f1245b21ce3ba407068c453a866c03d6.tar.gz
glibc-71451de2f1245b21ce3ba407068c453a866c03d6.tar.xz
glibc-71451de2f1245b21ce3ba407068c453a866c03d6.zip
Update.
2003-09-21  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Completely revamp the
	locking macros.  No distinction between normal and mutex locking
	anymore.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Rewrite mutex
	locking.  Merge bits from lowlevelmutex.S we still need.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Removed.
	* Makefile (routines): Remove libc-lowlevelmutex.
	(libpthread-rountines): Remove lowlevelmutex.
	* pthread_barrier_wait.S: Adjust for new mutex implementation.
	* pthread_cond_broadcast.S: Likewise.
	* pthread_cond_timedwait.S: Likewise.
	* pthread_cond_wait.S: Likewise.
	* pthread_rwlock_rdlock.S: Likewise.
	* pthread_rwlock_timedrdlock.S: Likewise.
	* pthread_rwlock_timedwrlock.S: Likewise.
	* pthread_rwlock_unlock.S: Likewise.
	* pthread_rwlock_wrlock.S: Likewise.
	* pthread_cond_signal.S: Likewise.  Don't use requeue.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S20
1 files changed, 11 insertions, 9 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
index 7d9aa93ebb..409c046b7b 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S
@@ -50,12 +50,13 @@ pthread_rwlock_timedrdlock:
 	movl	32(%esp), %edi
 
 	/* Get the lock.  */
-	movl	$1, %eax
+	movl	$1, %edx
+	xorl	%eax, %eax
 	LOCK
 #if MUTEX == 0
-	xaddl	%eax, (%ebp)
+	cmpxchgl %edx, (%ebp)
 #else
-	xaddl	%eax, MUTEX(%ebp)
+	cmpxchgl %edx, MUTEX(%ebp)
 #endif
 	testl	%eax, %eax
 	jne	1f
@@ -114,22 +115,23 @@ pthread_rwlock_timedrdlock:
 	leal	READERS_WAKEUP(%ebp), %ebx
 	movl	$SYS_futex, %eax
 	ENTER_KERNEL
-	movl	%eax, %edx
+	movl	%eax, %ecx
 17:
 
 	/* Reget the lock.  */
-	movl	$1, %eax
+	movl	$1, %edx
+	xorl	%eax, %eax
 	LOCK
 #if MUTEX == 0
-	xaddl	%eax, (%ebp)
+	cmpxchgl %edx, (%ebp)
 #else
-	xaddl	%eax, MUTEX(%ebp)
+	cmpxchgl %edx, MUTEX(%ebp)
 #endif
 	testl	%eax, %eax
 	jne	12f
 
 13:	subl	$1, READERS_QUEUED(%ebp)
-	cmpl	$-ETIMEDOUT, %edx
+	cmpl	$-ETIMEDOUT, %ecx
 	jne	2b
 
 18:	movl	$ETIMEDOUT, %ecx
@@ -207,7 +209,7 @@ pthread_rwlock_timedrdlock:
 	call	__lll_mutex_lock_wait
 	jmp	13b
 
-16:	movl	$-ETIMEDOUT, %edx
+16:	movl	$-ETIMEDOUT, %ecx
 	jmp	17b
 
 19:	movl	$EINVAL, %ecx