aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2003-03-20 09:51:17 +0000
committerRoland McGrath <roland@gnu.org>2003-03-20 09:51:17 +0000
commit100a7100a77029d3e56174c4a9124779c40a5d72 (patch)
treeea475925953a121f4809df0d7bb769c0417718bc
parent7d0878cc839492c5c6845deef645df3dd41b5441 (diff)
downloadglibc-100a7100a77029d3e56174c4a9124779c40a5d72.tar
glibc-100a7100a77029d3e56174c4a9124779c40a5d72.tar.gz
glibc-100a7100a77029d3e56174c4a9124779c40a5d72.tar.bz2
glibc-100a7100a77029d3e56174c4a9124779c40a5d72.zip
* sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
int for variable OLDVAL and correct inline assembler contraint. * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use type int for variable OLD. * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it only for s390-32. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h (SINGLE_THREAD_P): Use global variable __local_multiple_threads instead of multiple_threads field in the TCB.
-rw-r--r--nptl/ChangeLog13
-rw-r--r--nptl/sysdeps/s390/pthread_spin_lock.c4
-rw-r--r--nptl/sysdeps/s390/pthread_spin_trylock.c2
-rw-r--r--nptl/sysdeps/s390/tls.h4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h10
5 files changed, 23 insertions, 10 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index ccdc2dacb0..36361c6fe4 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,16 @@
+2003-03-20 Martin Schwidefsky <sky@mschwid3.boeblingen.de.ibm.com>
+
+ * sysdeps/s390/pthread_spin_lock.c (pthread_spin_lock): Use type
+ int for variable OLDVAL and correct inline assembler contraint.
+ * sysdeps/s390/pthread_spin_trylock.c (pthread_spin_trylock): Use
+ type int for variable OLD.
+
+ * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it
+ only for s390-32.
+ * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+ (SINGLE_THREAD_P): Use global variable __local_multiple_threads
+ instead of multiple_threads field in the TCB.
+
2003-03-19 Ulrich Drepper <drepper@redhat.com>
* sysdeps/i386/i686/bits/atomic.h: Removed.
diff --git a/nptl/sysdeps/s390/pthread_spin_lock.c b/nptl/sysdeps/s390/pthread_spin_lock.c
index 7d0067b0e9..f0fddf4ae8 100644
--- a/nptl/sysdeps/s390/pthread_spin_lock.c
+++ b/nptl/sysdeps/s390/pthread_spin_lock.c
@@ -23,12 +23,12 @@ int
pthread_spin_lock (lock)
pthread_spinlock_t *lock;
{
- unsigned long int oldval;
+ int oldval;
__asm __volatile ("0: lhi %0,0\n"
" cs %0,%2,%1\n"
" jl 0b"
- : "=d" (oldval), "=Q" (*lock)
+ : "=&d" (oldval), "=Q" (*lock)
: "d" (1), "m" (*lock) : "cc" );
return 0;
}
diff --git a/nptl/sysdeps/s390/pthread_spin_trylock.c b/nptl/sysdeps/s390/pthread_spin_trylock.c
index 8ed0a36647..0153b65dad 100644
--- a/nptl/sysdeps/s390/pthread_spin_trylock.c
+++ b/nptl/sysdeps/s390/pthread_spin_trylock.c
@@ -24,7 +24,7 @@ int
pthread_spin_trylock (lock)
pthread_spinlock_t *lock;
{
- unsigned long int old;
+ int old;
__asm __volatile ("cs %0,%3,%1"
: "=d" (old), "=Q" (*lock)
diff --git a/nptl/sysdeps/s390/tls.h b/nptl/sysdeps/s390/tls.h
index 4151f7fded..3f31823496 100644
--- a/nptl/sysdeps/s390/tls.h
+++ b/nptl/sysdeps/s390/tls.h
@@ -48,7 +48,9 @@ typedef struct
#endif
} tcbhead_t;
-# define TLS_MULTIPLE_THREADS_IN_TCB 1
+# ifndef __s390x__
+# define TLS_MULTIPLE_THREADS_IN_TCB 1
+# endif
#else /* __ASSEMBLER__ */
# include <tcb-offsets.h>
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
index 5a3ae51c23..c07c0442ea 100644
--- a/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+++ b/nptl/sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
@@ -79,15 +79,13 @@ L(pseudo_end):
#define LM_5 lmg %r2,%r5,16+160(%r15);
# ifndef __ASSEMBLER__
+extern int __local_multiple_threads attribute_hidden;
# define SINGLE_THREAD_P \
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
- header.multiple_threads) == 0, 1)
+ __builtin_expect (__local_multiple_threads == 0, 1)
# else
# define SINGLE_THREAD_P \
- ear %r1,%a0; \
- sllg %r1,%r1,32; \
- ear %r1,%a1; \
- icm %r1,15,MULTIPLE_THREADS_OFFSET(%r1);
+ larl %r1,__local_multiple_threads; \
+ icm %r0,15,0(%r1);
# endif
#elif !defined __ASSEMBLER__