aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/sysdeps/mips/pspinlock.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-16 01:02:04 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-16 01:02:04 +0000
commita99bfa85d82aecc3eb780779377a9e178e7189d2 (patch)
tree682a57a683bcf9e64cf0230f4a3648d20aa49217 /linuxthreads/sysdeps/mips/pspinlock.c
parent807bce82b385e7542f94a2fef994725b368a13b4 (diff)
downloadglibc-a99bfa85d82aecc3eb780779377a9e178e7189d2.zip
glibc-a99bfa85d82aecc3eb780779377a9e178e7189d2.tar.gz
glibc-a99bfa85d82aecc3eb780779377a9e178e7189d2.tar.bz2
Update.
2002-07-02 H.J. Lu <hjl@gnu.org> * sysdeps/mips/atomicity.h: Don't include <sgidefs.h>. Always use ll/sc. * sysdeps/unix/sysv/linux/mips/sys/tas.h: Likewise. * sysdeps/unix/sysv/linux/configure.in: Set arch_minimum_kernel to 2.4.0 for mips. TLS fail if USE_TLS is not defined.
Diffstat (limited to 'linuxthreads/sysdeps/mips/pspinlock.c')
-rw-r--r--linuxthreads/sysdeps/mips/pspinlock.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/linuxthreads/sysdeps/mips/pspinlock.c b/linuxthreads/sysdeps/mips/pspinlock.c
index 1aa372b..7dd66af 100644
--- a/linuxthreads/sysdeps/mips/pspinlock.c
+++ b/linuxthreads/sysdeps/mips/pspinlock.c
@@ -19,12 +19,9 @@
#include <errno.h>
#include <pthread.h>
-#include <sgidefs.h>
#include <sys/tas.h>
#include "internals.h"
-#if (_MIPS_ISA >= _MIPS_ISA_MIPS2)
-
/* This implementation is similar to the one used in the Linux kernel. */
int
__pthread_spin_lock (pthread_spinlock_t *lock)
@@ -34,10 +31,13 @@ __pthread_spin_lock (pthread_spinlock_t *lock)
asm volatile
("\t\t\t# spin_lock\n"
"1:\n\t"
+ ".set push\n\t"
+ ".set mips2\n\t"
"ll %1,%3\n\t"
"li %2,1\n\t"
"bnez %1,1b\n\t"
"sc %2,%0\n\t"
+ ".set pop\n\t"
"beqz %2,1b"
: "=m" (*lock), "=&r" (tmp1), "=&r" (tmp2)
: "m" (*lock)
@@ -46,17 +46,6 @@ __pthread_spin_lock (pthread_spinlock_t *lock)
return 0;
}
-#else /* !(_MIPS_ISA >= _MIPS_ISA_MIPS2) */
-
-int
-__pthread_spin_lock (pthread_spinlock_t *lock)
-{
- while (_test_and_set ((int *) lock, 1));
- return 0;
-}
-
-#endif /* !(_MIPS_ISA >= _MIPS_ISA_MIPS2) */
-
weak_alias (__pthread_spin_lock, pthread_spin_lock)