* [PATCH] SH nptl fixes
@ 2007-08-14 23:23 Kaz Kojima
2007-08-15 6:41 ` Ulrich Drepper
0 siblings, 1 reply; 2+ messages in thread
From: Kaz Kojima @ 2007-08-14 23:23 UTC (permalink / raw)
To: libc-hacker
Hi,
Here is a patch for SH to sync with the recent Jakub's nptl changes.
Regards,
kaz
--
2007-08-14 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
(__pthread_cond_broadcast): Pass LLL_PRIVATE to lll_* and or
FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
Don't use FUTEX_CMP_REQUEUE if dep_mutex is not process private.
* sysdeps/unix/sysv/linux/shpthread_cond_signal.S
(__pthread_cond_signal): Pass LLL_PRIVATE to lll_* and or
FUTEX_PRIVATE_FLAG into SYS_futex op if cv is process private.
Use FUTEX_WAKE_OP.
* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Include
kernel-features.h and tcb-offsets.h.
(__pthread_cond_wait, __condvar_w_cleanup): Pass LLL_PRIVATE to
lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
process private.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Include
tcb-offsets.h.
(__pthread_cond_timedwait, __condvar_tw_cleanup): Pass LLL_PRIVATE
to lll_* and or FUTEX_PRIVATE_FLAG into SYS_futex op if cv is
process private.
* sysdeps/unix/sysv/linux/sh/pthread_once.S: Use #ifdef
__ASSUME_PRIVATE_FUTEX instead of #if __ASSUME_PRIVATE_FUTEX.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S 2007-08-04 09:57:13.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_broadcast.S 2007-08-14 08:04:24.000000000 +0900
@@ -93,13 +93,24 @@ __pthread_cond_broadcast:
bt/s 9f
add #cond_futex, r4
- /* XXX: The kernel so far doesn't support requeue to PI futex. */
+ /* XXX: The kernel only supports FUTEX_CMP_REQUEUE to the same
+ type of futex (private resp. shared). */
mov.l @(MUTEX_KIND,r9), r0
- tst #PI_BIT, r0
+ tst #(PI_BIT|PS_BIT), r0
bf 9f
/* Wake up all threads. */
- mov #FUTEX_CMP_REQUEUE, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_CMP_REQUEUE|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_CMP_REQUEUE, r0
+ or r0, r5
+#endif
mov #1, r6
mov #-1, r7
shlr r7 /* r7 = 0x7fffffff */
@@ -156,7 +167,12 @@ __pthread_cond_broadcast:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait5, r1
bsrf r1
@@ -171,7 +187,12 @@ __pthread_cond_broadcast:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lwake5, r1
bsrf r1
extu.b r5, r5
@@ -185,7 +206,12 @@ __pthread_cond_broadcast:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov #-1, r0
+ cmp/eq r0, r9
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lwake6, r1
bsrf r1
extu.b r5, r5
@@ -194,7 +220,22 @@ __pthread_cond_broadcast:
nop
9:
- mov #FUTEX_WAKE, r5
+ mov #-1, r0
+ cmp/eq r0, r9
+ bt/s 99f
+ mov #FUTEX_WAKE, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAKE, r0
+ or r0, r5
+#endif
+99:
mov #-1, r6
shlr r6 /* r6 = 0x7fffffff */
mov #0, r7
@@ -205,6 +246,11 @@ __pthread_cond_broadcast:
bra 10b
nop
+#ifndef __ASSUME_PRIVATE_FUTEX
+.Lpfoff:
+ .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
+#endif
+
.align 2
.Lwait5:
.long __lll_lock_wait-.Lwait5b
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S 2007-08-04 09:57:13.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_signal.S 2007-08-14 08:04:24.000000000 +0900
@@ -74,14 +74,63 @@ __pthread_cond_signal:
/* Wake up one thread. */
mov r8, r4
add #cond_futex, r4
- mov #FUTEX_WAKE, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAKE_OP, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAKE_OP, r0
+ or r0, r5
+#endif
+99:
mov #1, r6
mov #0, r7
+ mov r8, r0
+ add #cond_lock, r0
+ mov.l .Lfutexop, r1
mov #SYS_futex, r3
extu.b r3, r3
trapa #0x14
SYSCALL_INST_PAD
+ /* For any kind of error, we try again with WAKE.
+ The general test also covers running on old kernels. */
+ mov r0, r1
+ mov #-12, r2
+ shad r2, r1
+ not r1, r1
+ tst r1, r1
+ bt 7f
+
+6:
+ mov #0, r0
+ lds.l @r15+, pr
+ rts
+ mov.l @r15+, r8
+
+#ifndef __ASSUME_PRIVATE_FUTEX
+.Lpfoff:
+ .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
+#endif
+ .align 2
+.Lfutexop:
+ .long FUTEX_OP_CLEAR_WAKE_IF_GT_ONE
+
+7:
+ /* r5 should be either FUTEX_WAKE_OP or
+ FUTEX_WAKE_OP|FUTEX_PRIVATE_FLAG from the previous syscall. */
+ mov #(FUTEX_WAKE ^ FUTEX_WAKE_OP), r0
+ xor r0, r5
+ trapa #0x14
+ SYSCALL_INST_PAD
+
4:
/* Unlock. */
#if cond_lock != 0
@@ -90,12 +139,26 @@ __pthread_cond_signal:
DEC (@r8, r2)
#endif
tst r2, r2
- bf 5f
-6:
- mov #0, r0
- lds.l @r15+, pr
- rts
- mov.l @r15+, r8
+ bt 6b
+
+5:
+ /* Unlock in loop requires wakeup. */
+ mov r8, r4
+#if cond_lock != 0
+ add #cond_lock, r4
+#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
+ mov #LLL_SHARED, r5
+99:
+ mov.l .Lwake4, r1
+ bsrf r1
+ extu.b r5, r5
+.Lwake4b:
+ bra 6b
+ nop
1:
/* Initial locking failed. */
@@ -103,7 +166,12 @@ __pthread_cond_signal:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait4, r1
bsrf r1
@@ -112,20 +180,6 @@ __pthread_cond_signal:
bra 2b
nop
-5:
- /* Unlock in loop requires wakeup. */
- mov r8, r4
-#if cond_lock != 0
- add #cond_lock, r4
-#endif
- mov #LLL_SHARED, r5
- mov.l .Lwake4, r1
- bsrf r1
- extu.b r5, r5
-.Lwake4b:
- bra 6b
- nop
-
.align 2
.Lwait4:
.long __lll_lock_wait-.Lwait4b
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S 2007-08-14 08:00:47.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S 2007-08-14 08:05:35.000000000 +0900
@@ -21,8 +21,9 @@
#include <lowlevellock.h>
#include <lowlevelcond.h>
#include <pthread-errnos.h>
-#include "lowlevel-atomic.h"
#include <kernel-features.h>
+#include <tcb-offsets.h>
+#include "lowlevel-atomic.h"
.text
@@ -230,7 +231,22 @@ __pthread_cond_timedwait:
mov r15, r7
add #16, r7
- mov #FUTEX_WAIT, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAIT, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAIT|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAIT, r0
+ or r0, r5
+#endif
+99:
mov.l @(8,r15), r6
mov r8, r4
add #cond_futex, r4
@@ -339,7 +355,22 @@ __pthread_cond_timedwait:
mov r8, r4
add #cond_nwaiters, r4
- mov #FUTEX_WAKE, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAKE, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAKE, r0
+ or r0, r5
+#endif
+99:
mov #1, r6
mov #0, r7
mov #SYS_futex, r3
@@ -379,6 +410,10 @@ __pthread_cond_timedwait:
rts
mov.l @r15+, r8
+#ifndef __ASSUME_PRIVATE_FUTEX
+.Lpfoff:
+ .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
+#endif
.L1k:
.word 1000
.align 2
@@ -399,7 +434,12 @@ __pthread_cond_timedwait:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait2, r1
bsrf r1
@@ -414,7 +454,12 @@ __pthread_cond_timedwait:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lmwait2, r1
bsrf r1
extu.b r5, r5
@@ -428,7 +473,12 @@ __pthread_cond_timedwait:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait3, r1
bsrf r1
@@ -443,7 +493,12 @@ __pthread_cond_timedwait:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lmwait3, r1
bsrf r1
extu.b r5, r5
@@ -466,7 +521,12 @@ __pthread_cond_timedwait:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lmwait4, r1
bsrf r1
extu.b r5, r5
@@ -510,7 +570,12 @@ __condvar_tw_cleanup:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait5, r1
bsrf r1
@@ -605,7 +670,12 @@ __condvar_tw_cleanup:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lmwait5, r1
bsrf r1
extu.b r5, r5
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S 2007-08-04 09:57:13.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S 2007-08-14 08:04:24.000000000 +0900
@@ -20,6 +20,8 @@
#include <shlib-compat.h>
#include <lowlevellock.h>
#include <lowlevelcond.h>
+#include <tcb-offsets.h>
+#include <kernel-features.h>
#include "lowlevel-atomic.h"
.text
@@ -135,7 +137,22 @@ __pthread_cond_wait:
mov.l r0, @r15
mov #0, r7
- mov #FUTEX_WAIT, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAIT, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAIT|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff0, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAIT, r0
+ or r0, r5
+#endif
+99:
mov.l @(8,r15), r6
mov r8, r4
add #cond_futex, r4
@@ -213,7 +230,22 @@ __pthread_cond_wait:
mov r8, r4
add #cond_nwaiters, r4
- mov #FUTEX_WAKE, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAKE, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff0, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAKE, r0
+ or r0, r5
+#endif
+99:
mov #1, r6
mov #0, r7
mov #SYS_futex, r3
@@ -247,6 +279,10 @@ __pthread_cond_wait:
rts
mov.l @r15+, r8
+#ifndef __ASSUME_PRIVATE_FUTEX
+.Lpfoff0:
+ .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
+#endif
.align 2
.Lmunlock0:
.long __pthread_mutex_unlock_usercnt-.Lmunlock0b
@@ -263,7 +299,12 @@ __pthread_cond_wait:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait0, r1
bsrf r1
@@ -277,7 +318,12 @@ __pthread_cond_wait:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lwake0, r1
bsrf r1
extu.b r5, r5
@@ -291,7 +337,12 @@ __pthread_cond_wait:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait1, r1
bsrf r1
@@ -306,7 +357,12 @@ __pthread_cond_wait:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lwake1, r1
bsrf r1
extu.b r5, r5
@@ -329,7 +385,12 @@ __pthread_cond_wait:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lwake2, r1
bsrf r1
extu.b r5, r5
@@ -374,7 +435,12 @@ __condvar_w_cleanup:
#if cond_lock != 0
add #cond_lock, r5
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r6
mov #LLL_SHARED, r6
+99:
extu.b r6, r6
mov.l .Lwait3, r1
bsrf r1
@@ -447,7 +513,22 @@ __condvar_w_cleanup:
mov r8, r4
add #cond_nwaiters, r4
- mov #FUTEX_WAKE, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAKE, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff1, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAKE, r0
+ or r0, r5
+#endif
+99:
mov #1, r6
mov #0, r7
mov #SYS_futex, r3
@@ -469,7 +550,12 @@ __condvar_w_cleanup:
#if cond_lock != 0
add #cond_lock, r4
#endif
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bf/s 99f
+ mov #LLL_PRIVATE, r5
mov #LLL_SHARED, r5
+99:
mov.l .Lwake3, r1
bsrf r1
extu.b r5, r5
@@ -481,7 +567,22 @@ __condvar_w_cleanup:
bf/s 5f
mov r8, r4
add #cond_futex, r4
- mov #FUTEX_WAKE, r5
+ mov.l @(dep_mutex,r8), r0
+ cmp/eq #-1, r0
+ bt/s 99f
+ mov #FUTEX_WAKE, r5
+#ifdef __ASSUME_PRIVATE_FUTEX
+ mov #(FUTEX_WAKE|FUTEX_PRIVATE_FLAG), r5
+ extu.b r5, r5
+#else
+ stc gbr, r1
+ mov.w .Lpfoff1, r2
+ add r2, r1
+ mov.l @r1, r5
+ mov #FUTEX_WAKE, r0
+ or r0, r5
+#endif
+99:
mov #-1, r6
shlr r6 /* r6 = 0x7fffffff */
mov #0, r7
@@ -505,6 +606,10 @@ __condvar_w_cleanup:
mov r11, r4
sleep
+#ifndef __ASSUME_PRIVATE_FUTEX
+.Lpfoff1:
+ .word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
+#endif
.align 2
.Lwait3:
.long __lll_lock_wait-.Lwait3b
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S 2007-08-04 09:57:13.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_once.S 2007-08-14 08:04:24.000000000 +0900
@@ -94,7 +94,7 @@ __pthread_once:
bf 3f /* Different for generation -> run initializer. */
/* Somebody else got here first. Wait. */
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAIT), r5
extu.b r5, r5
#else
@@ -168,7 +168,7 @@ __pthread_once:
INC (@r9, r2)
/* Wake up all other threads. */
mov r9, r4
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAKE), r5
extu.b r5, r5
#else
@@ -213,7 +213,7 @@ __pthread_once:
mov #0, r7
mov.l r7, @r9
mov r9, r4
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAKE), r5
#else
stc gbr, r1
@@ -239,7 +239,7 @@ __pthread_once:
sleep
cfi_endproc
-#if !__ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_PRIVATE_FUTEX
.Lpfoff:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S 2007-08-04 09:57:13.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S 2007-08-14 08:04:24.000000000 +0900
@@ -74,7 +74,7 @@ __pthread_rwlock_rdlock:
tst r2, r2
bf 10f
11:
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #PSHARED, r0
mov.b @(r0,r8), r5
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAIT), r0
@@ -142,7 +142,7 @@ __pthread_rwlock_rdlock:
rts
mov r3, r0
-#if !__ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_PRIVATE_FUTEX
.Lpfoff:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S 2007-08-04 09:57:14.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S 2007-08-14 08:04:24.000000000 +0900
@@ -115,7 +115,7 @@ pthread_rwlock_timedrdlock:
/* Futex call. */
mov r15, r7
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #PSHARED, r0
mov.b @(r0,r8), r5
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAIT), r0
@@ -193,7 +193,7 @@ pthread_rwlock_timedrdlock:
rts
mov r3, r0
-#if !__ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_PRIVATE_FUTEX
.Lpfoff:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S 2007-08-04 09:57:14.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S 2007-08-14 08:04:24.000000000 +0900
@@ -111,7 +111,7 @@ pthread_rwlock_timedwrlock:
/* Futex call. */
mov r15, r7
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #PSHARED, r0
mov.b @(r0,r8), r5
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAIT), r0
@@ -191,7 +191,7 @@ pthread_rwlock_timedwrlock:
rts
mov r3, r0
-#if !__ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_PRIVATE_FUTEX
.Lpfoff:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S 2007-08-04 09:57:14.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_unlock.S 2007-08-14 08:04:24.000000000 +0900
@@ -85,7 +85,7 @@ __pthread_rwlock_unlock:
bf 7f
8:
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #PSHARED, r0
mov.b @(r0,r8), r5
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAKE), r0
@@ -177,7 +177,7 @@ __pthread_rwlock_unlock:
bra 8b
mov.l @r15+, r4
-#if !__ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_PRIVATE_FUTEX
.Lpfoff:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
diff -uprN ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S
--- ORIG/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S 2007-08-04 09:57:14.000000000 +0900
+++ LOCAL/libc/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S 2007-08-14 08:04:24.000000000 +0900
@@ -72,7 +72,7 @@ __pthread_rwlock_wrlock:
11:
mov r8, r4
add #WRITERS_WAKEUP, r4
-#if __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_PRIVATE_FUTEX
mov #PSHARED, r0
mov.b @(r0,r8), r5
mov #(FUTEX_PRIVATE_FLAG|FUTEX_WAIT), r0
@@ -174,7 +174,7 @@ __pthread_rwlock_wrlock:
bra 7b
mov #0, r3
-#if !__ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_PRIVATE_FUTEX
.Lpfoff:
.word PRIVATE_FUTEX - TLS_PRE_TCB_SIZE
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] SH nptl fixes
2007-08-14 23:23 [PATCH] SH nptl fixes Kaz Kojima
@ 2007-08-15 6:41 ` Ulrich Drepper
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2007-08-15 6:41 UTC (permalink / raw)
To: Kaz Kojima; +Cc: libc-hacker
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Applied.
- --
â§ Ulrich Drepper â§ Red Hat, Inc. â§ 444 Castro St â§ Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFGwqAc2ijCOnn/RHQRAhfeAJ4ofTmQPwjWTPtyU6VyFe+f89SgVwCgi+9a
9xmMYG5t77+HevIVlF0RiR4=
=lf9c
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-15 6:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-14 23:23 [PATCH] SH nptl fixes Kaz Kojima
2007-08-15 6:41 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).