summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-10-03 06:27:04 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-10-03 06:27:04 +0200
commitedda0488a6879c1598bee908418cba14d66f9712 (patch)
treed77db4ac8b198b209f1ca7be8bb2add55aa49e7d /libpthread/linuxthreads/sysdeps/m68k/pspinlock.c
parent59fe21c468d852a08847a8bcb62dea56408b510e (diff)
m68k: fix linuxthreads compile for coldfire
The tas instruction is not available for most coldfire CPU's. Use bset instead in this case as already used in linuxthreads.old.
Diffstat (limited to 'libpthread/linuxthreads/sysdeps/m68k/pspinlock.c')
-rw-r--r--libpthread/linuxthreads/sysdeps/m68k/pspinlock.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c b/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c
index c26a2786f..af77c2a9d 100644
--- a/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c
+++ b/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c
@@ -27,10 +27,15 @@ __pthread_spin_lock (pthread_spinlock_t *lock)
unsigned int val;
do
- __asm__ __volatile__ ("tas %1; sne %0"
- : "=dm" (val), "=m" (*lock)
- : "m" (*lock)
- : "cc");
+ __asm__ __volatile__ (
+#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__m68000)
+ "tas %1; sne %0"
+#else
+ "bset #7,%1; sne %0"
+#endif
+ : "=dm" (val), "=m" (*lock)
+ : "m" (*lock)
+ : "cc");
while (val);
return 0;
@@ -43,7 +48,12 @@ __pthread_spin_trylock (pthread_spinlock_t *lock)
{
unsigned int val;
- __asm__ __volatile__ ("tas %1; sne %0"
+ __asm__ __volatile__ (
+#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__m68000)
+ "tas %1; sne %0"
+#else
+ "bset #7,%1; sne %0"
+#endif
: "=dm" (val), "=m" (*lock)
: "m" (*lock)
: "cc");