summaryrefslogtreecommitdiff
path: root/arch/arm/pthread_arch.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-04-30 15:32:11 -0400
committerRich Felker <dalias@aerifal.cx>2014-04-30 15:32:11 -0400
commite783efa6eff5e0b8c91891f778598a95e1f7ad87 (patch)
tree99db96f8cf6477e943084a4fb606f667ee284797 /arch/arm/pthread_arch.h
parent468bc11ed059c475f974920ac3d499e6071a6b2c (diff)
downloadmusl-e783efa6eff5e0b8c91891f778598a95e1f7ad87.tar.gz
fix arm thread-pointer/atomic asm when compiling to thumb code
armv7/thumb2 provides a way to do atomics in thumb mode, but for armv6 we need a call to arm mode. this commit is based on a patch by Stephen Thomas which fixed the armv7 cases but not the armv6 ones. all of this should be revisited if/when runtime selection of thread pointer access and atomics are added.
Diffstat (limited to 'arch/arm/pthread_arch.h')
-rw-r--r--arch/arm/pthread_arch.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/arm/pthread_arch.h b/arch/arm/pthread_arch.h
index ec77a833..6d9dc3a6 100644
--- a/arch/arm/pthread_arch.h
+++ b/arch/arm/pthread_arch.h
@@ -1,6 +1,5 @@
-#if __ARM_ARCH_6K__ || __ARM_ARCH_6ZK__ \
- || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ \
- || __ARM_ARCH >= 7
+#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6ZK__) && !__thumb__) \
+ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
static inline __attribute__((const)) pthread_t __pthread_self()
{