summaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog33
-rw-r--r--nptl/Makeconfig6
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h12
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/sem_post.S31
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S2
-rw-r--r--nptl/tst-eintr2.c4
10 files changed, 91 insertions, 26 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index ddb451f9ed..b9ba580bbe 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,36 @@
+2008-01-30 Ulrich Drepper <drepper@redhat.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/sem_post.S (sem_post): Avoid
+ unnecessary addr32 prefix.
+
+2008-01-29 Roland McGrath <roland@redhat.com>
+
+ * Makeconfig (ptw-CPPFLAGS, sysd-rules-patterns): New variables.
+
+2008-01-22 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sysdeps/unix/sysv/linux/sh/sem_post.S: Don't overflow value field.
+
+2008-01-21 Kaz Kojima <kkojima@rr.iij4u.or.jp>
+
+ * sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h (XADD): Use
+ a scratch register.
+ * sysdeps/unix/sysv/linux/sh/lowlevellock.S
+ (__lll_lock_wait_private): Fix typo.
+ * sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
+ (pthread_barrier_wait): Likewise. Adjust XADD use.
+ * sysdeps/unix/sysv/linux/sh/sem_post.S (__new_sem_post):
+ Adjust XADD use.
+ * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
+ (pthread_rwlock_timedrdlock): Return correct return value.
+ * sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
+ (pthread_rwlock_timedwrlock): Likewise.
+
+2008-01-15 Ulrich Drepper <drepper@redhat.com>
+
+ * tst-eintr2.c (do_test): make sure that if mutex_lock in main
+ thread returns the program exits with an error code.
+
2008-01-10 Ulrich Drepper <drepper@redhat.com>
* pthread-errnos.sym: Add EOVERFLOW.
diff --git a/nptl/Makeconfig b/nptl/Makeconfig
index 54e2f65b01..c6a8e46132 100644
--- a/nptl/Makeconfig
+++ b/nptl/Makeconfig
@@ -1,4 +1,4 @@
-# Copyright (C) 2002,2003,2005,2006 Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2005,2006,2008 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -28,3 +28,7 @@ static-thread-library = $(common-objpfx)nptl/libpthread.a
bounded-thread-library = $(common-objpfx)nptl/libpthread_b.a
rpath-dirs += nptl
+
+# This makes for ptw-*.? object rules in sysd-rules.
+ptw-CPPFLAGS := -DPTW
+sysd-rules-patterns += ptw-%:%
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h b/nptl/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h
index 76d22c88f9..c7028360f5 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h
+++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevel-atomic.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -44,14 +44,16 @@
mov.l reg, mem; \
99: mov r1, r15
-#define XADD(reg, mem, old) \
+#define XADD(reg, mem, old, tmp) \
.align 2; \
mova 99f, r0; \
+ nop; \
mov r15, r1; \
- mov _IMM6, r15; \
+ mov _IMM8, r15; \
98: mov.l mem, old; \
- add old, reg; \
- mov.l reg, mem; \
+ mov reg, tmp; \
+ add old, tmp; \
+ mov.l tmp, mem; \
99: mov r1, r15
#define XCHG(reg, mem, old) \
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
index afcf0be299..d8279173d7 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S
@@ -1,4 +1,5 @@
-/* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -143,7 +144,7 @@ __lll_lock_wait_private:
bf 1b
mov.l @r15+, r8
- ret
+ rts
mov r2, r0
cfi_endproc
.size __lll_lock_wait_private,.-__lll_lock_wait_private
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
index c7d7d2278d..4a6059aef4 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -86,7 +86,7 @@ pthread_barrier_wait:
initial count unlock the object. */
mov #1, r3
mov.l @(INIT_COUNT,r8), r4
- XADD (r3, @(LEFT,r8), r2)
+ XADD (r3, @(LEFT,r8), r2, r5)
add #-1, r4
cmp/eq r2, r4
bf 10f
@@ -131,7 +131,7 @@ pthread_barrier_wait:
initial count unlock the object. */
mov #1, r3
mov.l @(INIT_COUNT,r8), r4
- XADD (r3, @(LEFT,r8), r2)
+ XADD (r3, @(LEFT,r8), r2, r5)
add #-1, r4
cmp/eq r2, r4
bf 5f
@@ -144,7 +144,7 @@ pthread_barrier_wait:
mov #-1, r0 /* == PTHREAD_BARRIER_SERIAL_THREAD */
lds.l @r15+, pr
mov.l @r15+, r8
- ret
+ rts
mov.l @r15+, r9
1:
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
index e40771de0f..743f283be5 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -232,6 +232,7 @@ pthread_rwlock_timedrdlock:
.word TID - TLS_PRE_TCB_SIZE
6:
+ mov r3, r10
mov r8, r4
#if MUTEX != 0
add #MUTEX, r4
@@ -244,7 +245,7 @@ pthread_rwlock_timedrdlock:
nop
.Lwake2b:
bra 7b
- mov #0, r3
+ mov r10, r3
8:
/* Overflow. */
@@ -278,6 +279,7 @@ pthread_rwlock_timedrdlock:
nop
12:
+ mov r3, r10
mov r8, r5
#if MUTEX != 0
add #MUTEX, r5
@@ -290,7 +292,7 @@ pthread_rwlock_timedrdlock:
mov r2, r4
.Lwait3b:
bra 13b
- nop
+ mov r10, r3
16:
bra 17b
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 dfe137973c..307494c8c2 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -225,6 +225,7 @@ pthread_rwlock_timedwrlock:
bra 9b
mov #EDEADLK, r3
6:
+ mov r3, r10
mov r8, r4
#if MUTEX != 0
add #MUTEX, r4
@@ -237,7 +238,7 @@ pthread_rwlock_timedwrlock:
nop
.Lwake6b:
bra 7b
- mov #0, r3
+ mov r10, r3
.Ltidoff:
.word TID - TLS_PRE_TCB_SIZE
@@ -266,6 +267,7 @@ pthread_rwlock_timedwrlock:
nop
12:
+ mov r3, r10
mov r8, r5
#if MUTEX != 0
add #MUTEX, r5
@@ -278,7 +280,7 @@ pthread_rwlock_timedwrlock:
mov r2, r4
.Lwait7b:
bra 13b
- nop
+ mov r10, r3
16:
bra 17b
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S b/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S
index a3a7710ef9..4a154fc649 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/sem_post.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,8 +30,16 @@
.type __new_sem_post,@function
.align 5
__new_sem_post:
- mov #1, r3
- XADD (r3, @(VALUE,r4), r2)
+ mov.l @(VALUE,r4), r2
+0:
+ mov.l .Lmax, r1
+ cmp/eq r1, r2
+ bt/s 3f
+ mov r2, r3
+ mov r3, r5
+ add #1, r5
+ CMPXCHG (r3, @(VALUE,r4), r5, r2)
+ bf 0b
mov.l @(NWAITERS,r4), r2
tst r2, r2
bt 2f
@@ -52,7 +60,15 @@ __new_sem_post:
mov #0, r0
1:
- mov #EINVAL, r2
+ bra 4f
+ mov #EINVAL, r2
+
+3:
+ mov #EOVERFLOW, r2
+4:
+ mov.l r12, @-r15
+ mov.l r8, @-r15
+ sts.l pr, @-r15
mova .Lgot3, r0
mov.l .Lgot3, r12
add r0, r12
@@ -67,19 +83,24 @@ __new_sem_post:
.Lerrno3:
.long errno@GOTTPOFF
.Lexit:
+ mov.l r2, @r0
#else
+ mov r2, r8
mov.l .Lerrloc3, r1
bsrf r1
nop
.Lerrloc3b:
+ mov r8, @r0
#endif
- mov.l r2, @r0
lds.l @r15+, pr
+ mov.l @r15+, r8
mov.l @r15+, r12
rts
mov #-1, r0
.align 2
+.Lmax:
+ .long SEM_VALUE_MAX
.Lgot3:
.long _GLOBAL_OFFSET_TABLE_
#if !USE___THREAD
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
index b4014c6505..979b1bf1d6 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_post.S
@@ -37,7 +37,7 @@ sem_post:
#endif
0: cmpl $SEM_VALUE_MAX, %eax
je 3f
- leal 1(%eax), %esi
+ leal 1(%rax), %esi
LOCK
#if VALUE == 0
cmpxchgl %esi, (%rdi)
diff --git a/nptl/tst-eintr2.c b/nptl/tst-eintr2.c
index 8cbbc5a026..b7436a66ac 100644
--- a/nptl/tst-eintr2.c
+++ b/nptl/tst-eintr2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@@ -109,7 +109,7 @@ do_test (void)
printf ("main: mutex_lock returned: %s\n",
strerror_r (e, buf, sizeof (buf)));
- return 0;
+ return 1;
}
#define EXPECTED_SIGNAL SIGALRM