summaryrefslogtreecommitdiffstats
path: root/libpthread/linuxthreads
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-08-17 14:48:11 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-08-17 14:48:11 +0000
commit54a7d559374ef72fa59bbe3a56d27ff5ec34d3aa (patch)
tree1fe7209313f2728c550d3eb75929b4af051fb349 /libpthread/linuxthreads
parentb46868ff8b3d2fb592e3fca4a516695533eae9e5 (diff)
downloaduClibc-alpine-54a7d559374ef72fa59bbe3a56d27ff5ec34d3aa.tar.bz2
uClibc-alpine-54a7d559374ef72fa59bbe3a56d27ff5ec34d3aa.tar.xz
Merge/sync with trunk.
Diffstat (limited to 'libpthread/linuxthreads')
-rw-r--r--libpthread/linuxthreads/Makefile2
-rw-r--r--libpthread/linuxthreads/sysdeps/arm/pt-machine.h15
2 files changed, 16 insertions, 1 deletions
diff --git a/libpthread/linuxthreads/Makefile b/libpthread/linuxthreads/Makefile
index 2f66fab21..cca65d51c 100644
--- a/libpthread/linuxthreads/Makefile
+++ b/libpthread/linuxthreads/Makefile
@@ -39,9 +39,9 @@ CFLAGS :=$(CFLAGS:-O0=-O1)
# set up system dependencies include dirs (NOTE: order matters!)
+PTDIR = $(TOPDIR)libpthread/linuxthreads/
SYSDEPINC = -I$(PTDIR)sysdeps/pthread \
-I$(PTDIR)sysdeps/$(TARGET_ARCH) \
- -I$(PTDIR)sysdeps \
-I$(TOPDIR)libc/sysdeps/linux/$(TARGET_ARCH)
CFLAGS += $(SYSDEPINC)
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;
}