about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S35
1 files changed, 20 insertions, 15 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
index 18641fe9df..4591309ecc 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
@@ -17,18 +17,13 @@
    02111-1307 USA.  */
 
 #include <sysdep.h>
+#include <lowlevellock.h>
 #include <lowlevelrwlock.h>
 #include <pthread-errnos.h>
 #include <tcb-offsets.h>
 #include <kernel-features.h>
 #include "lowlevel-atomic.h"
 
-#define SYS_gettimeofday	__NR_gettimeofday
-#define SYS_futex		240
-#define FUTEX_WAIT		0
-#define FUTEX_WAKE		1
-#define FUTEX_PRIVATE_FLAG    128
-
 
 	.text
 
@@ -88,7 +83,7 @@ pthread_rwlock_timedwrlock:
 	/* Get current time.  */
 	mov	r15, r4
 	mov	#0, r5
-	mov	#SYS_gettimeofday, r3
+	mov	#__NR_gettimeofday, r3
 	trapa	#0x12
 	SYSCALL_INST_PAD
 
@@ -211,10 +206,12 @@ pthread_rwlock_timedwrlock:
 #if MUTEX != 0
 	add	#MUTEX, r5
 #endif
-	mov	r2, r4
+	mov	#PSHARED, r0
+	mov.b	@(r0,r8), r6
+	extu.b	r6, r6
 	mov.l	.Lwait6, r1
 	bsrf	r1
-	 nop
+	 mov	r2, r4
 .Lwait6b:
 	bra	2b
 	 nop
@@ -232,6 +229,9 @@ pthread_rwlock_timedwrlock:
 #if MUTEX != 0
 	add	#MUTEX, r4
 #endif
+	mov	#PSHARED, r0
+	mov.b	@(r0,r8), r5
+	extu.b	r5, r5
 	mov.l	.Lwake6, r1
 	bsrf	r1
 	 nop
@@ -255,6 +255,9 @@ pthread_rwlock_timedwrlock:
 #if MUTEX != 0
 	add	#MUTEX, r4
 #endif
+	mov	#PSHARED, r0
+	mov.b	@(r0,r8), r5
+	extu.b	r5, r5
 	mov.l	.Lwake7, r1
 	bsrf	r1
 	 nop
@@ -267,10 +270,12 @@ pthread_rwlock_timedwrlock:
 #if MUTEX != 0
 	add	#MUTEX, r5
 #endif
-	mov	r2, r4
+	mov	#PSHARED, r0
+	mov.b	@(r0,r8), r6
+	extu.b	r6, r6
 	mov.l	.Lwait7, r1
 	bsrf	r1
-	 nop
+	 mov	r2, r4
 .Lwait7b:
 	bra	13b
 	 nop
@@ -281,11 +286,11 @@ pthread_rwlock_timedwrlock:
 
 	.align	2
 .Lwait6:
-	.long	__lll_mutex_lock_wait-.Lwait6b
+	.long	__lll_lock_wait-.Lwait6b
 .Lwake6:
-	.long	__lll_mutex_unlock_wake-.Lwake6b
+	.long	__lll_unlock_wake-.Lwake6b
 .Lwait7:
-	.long	__lll_mutex_lock_wait-.Lwait7b
+	.long	__lll_lock_wait-.Lwait7b
 .Lwake7:
-	.long	__lll_mutex_unlock_wake-.Lwake7b
+	.long	__lll_unlock_wake-.Lwake7b
 	.size	pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock