From 2974b2a72237fa7abcb850b3f67b8375a65fbcb2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 15 Aug 2005 03:06:11 +0000 Subject: import thumb support from jbowler in Bug 385 --- libpthread/linuxthreads/sysdeps/arm/pt-machine.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libpthread') diff --git a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h index 71001ebc2..284567970 100644 --- a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h @@ -39,9 +39,24 @@ testandset (int *spinlock) { register unsigned int ret; +#if defined(__thumb__) + void *pc; + __asm__ __volatile__( + ".align 0\n" + "\tbx pc\n" + "\tnop\n" + "\t.arm\n" + "\tswp %0, %2, [%3]\n" + "\torr %1, pc, #1\n" + "\tbx %1\n" + "\t.force_thumb" + : "=r"(ret), "=r"(pc) + : "0"(1), "r"(spinlock)); +#else __asm__ __volatile__("swp %0, %1, [%2]" : "=r"(ret) : "0"(1), "r"(spinlock)); +#endif return ret; } -- cgit v1.2.3