about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
index 8303a984ae..172689bec3 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
@@ -37,13 +37,13 @@ __pthread_rwlock_unlock:
 	mov	r4, r8
 
 	/* Get the lock.  */
-	mov	#1, r3
+	mov	#0, r3
+	mov	#1, r4
 #if MUTEX == 0
-	XADD	(r3, @r4, r2)
+	CMPXCHG (r3, @r8, r4, r2)
 #else
-	XADD	(r3, @(MUTEX,r4), r2)
+	CMPXCHG (r3, @(MUTEX,r8), r4, r2)
 #endif
-	tst	r2, r2
 	bf	1f
 2:
 	mov.l	@(WRITER,r8), r0