summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
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/pt-machine.h
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/pt-machine.h')
-rw-r--r--libpthread/linuxthreads/sysdeps/m68k/pt-machine.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h b/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
index e2d7bdc81..1eb9fd57b 100644
--- a/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
@@ -28,12 +28,18 @@
#endif
/* Spinlock implementation; required. */
+PT_EI long int testandset (int *spinlock);
PT_EI long int
testandset (int *spinlock)
{
char ret;
- __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"(ret), "=m"(*spinlock)
: "m"(*spinlock)
: "cc");
@@ -50,6 +56,7 @@ register char * stack_pointer __asm__ ("%sp");
/* Compare-and-swap for semaphores. */
+#if !defined(__mcoldfire__) && !defined(__mcf5200__) && !defined(__mc68000)
#define HAS_COMPARE_AND_SWAP
PT_EI int
__compare_and_swap (long int *p, long int oldval, long int newval)
@@ -63,5 +70,5 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
return ret;
}
-
+#endif
#endif /* pt-machine.h */