From a99bfa85d82aecc3eb780779377a9e178e7189d2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 16 Jul 2002 01:02:04 +0000 Subject: Update. 2002-07-02 H.J. Lu * sysdeps/mips/atomicity.h: Don't include . 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. --- linuxthreads/ChangeLog | 6 ++++++ linuxthreads/sysdeps/mips/pspinlock.c | 17 +++-------------- linuxthreads/sysdeps/mips/pt-machine.h | 8 +++----- 3 files changed, 12 insertions(+), 19 deletions(-) (limited to 'linuxthreads') diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index ec04411..e70be81 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,9 @@ +2002-07-02 H.J. Lu + + * sysdeps/mips/pspinlock.c: Don't include . Always + use ll/sc. + * sysdeps/mips/pt-machine.h: Likewise. + 2002-07-14 Ulrich Drepper * manager.c (pthread_handle_create): Initialize self-reference in 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 #include -#include #include #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) diff --git a/linuxthreads/sysdeps/mips/pt-machine.h b/linuxthreads/sysdeps/mips/pt-machine.h index 31a3421..2bad942 100644 --- a/linuxthreads/sysdeps/mips/pt-machine.h +++ b/linuxthreads/sysdeps/mips/pt-machine.h @@ -23,7 +23,6 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 -#include #include #ifndef PT_EI @@ -51,8 +50,6 @@ register char * stack_pointer __asm__ ("$29"); /* Compare-and-swap for semaphores. */ -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) - #define HAS_COMPARE_AND_SWAP PT_EI int __compare_and_swap (long int *p, long int oldval, long int newval) @@ -62,11 +59,14 @@ __compare_and_swap (long int *p, long int oldval, long int newval) __asm__ __volatile__ ("/* Inline compare & swap */\n" "1:\n\t" + ".set push\n\t" + ".set mips2\n\t" "ll %1,%5\n\t" "move %0,$0\n\t" "bne %1,%3,2f\n\t" "move %0,%4\n\t" "sc %0,%2\n\t" + ".set pop\n\t" "beqz %0,1b\n" "2:\n\t" "/* End compare & swap */" @@ -77,6 +77,4 @@ __compare_and_swap (long int *p, long int oldval, long int newval) return ret; } -#endif /* (_MIPS_ISA >= _MIPS_ISA_MIPS2) */ - #endif /* pt-machine.h */ -- cgit v1.1