summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/arm/bits
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-04-24 19:57:28 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2015-04-24 19:57:28 -0500
commit928ab832caa67c0c1a44e3a8e1483b0ed33cda50 (patch)
tree6e3df2d0437f834971fe28bdf519a2c8da694fc1 /libc/sysdeps/linux/arm/bits
parent74c69da52ad5029cd2fc2d3d41d581022ed0a7aa (diff)
parentf1f98784e65ce9621a570af50998b1940e7fb81d (diff)
merge uClibc changes
Diffstat (limited to 'libc/sysdeps/linux/arm/bits')
-rw-r--r--libc/sysdeps/linux/arm/bits/arm_asm.h12
-rw-r--r--libc/sysdeps/linux/arm/bits/arm_bx.h12
-rw-r--r--libc/sysdeps/linux/arm/bits/uClibc_arch_features.h26
3 files changed, 41 insertions, 9 deletions
diff --git a/libc/sysdeps/linux/arm/bits/arm_asm.h b/libc/sysdeps/linux/arm/bits/arm_asm.h
index 04664b376..898a78bcc 100644
--- a/libc/sysdeps/linux/arm/bits/arm_asm.h
+++ b/libc/sysdeps/linux/arm/bits/arm_asm.h
@@ -13,12 +13,12 @@
unified assembly syntax. */
#define IT(t, cond)
/* Code to return from a thumb function stub. */
-#ifdef __ARM_ARCH_4T__
-#define POP_RET pop {r2, pc}
-#else
-#define POP_RET pop {r2, r3}; bx r3
-#endif
-#endif
+# if defined __ARM_ARCH_4T__ && defined __THUMB_INTERWORK__
+# define POP_RET pop {r2, r3}; bx r3
+# else
+# define POP_RET pop {r2, pc}
+# endif
+#endif /* __thumb2__ */
#if defined(__ARM_ARCH_6M__)
/* Force arm mode to flush out errors on M profile cores. */
diff --git a/libc/sysdeps/linux/arm/bits/arm_bx.h b/libc/sysdeps/linux/arm/bits/arm_bx.h
index 321490e55..2c290896d 100644
--- a/libc/sysdeps/linux/arm/bits/arm_bx.h
+++ b/libc/sysdeps/linux/arm/bits/arm_bx.h
@@ -24,11 +24,17 @@
#endif /* features.h not yet included */
#if defined(__USE_BX__)
-# if ( defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \
- || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
- )
+# if (__ARM_ARCH <= 4 && !defined __ARM_ARCH_4T__)
# error Use of BX was requested, but is not available on the target processor.
# endif /* ARCH level */
#endif /* __USE_BX__ */
+#if defined(__USE_BX__) && (__ARM_ARCH > 4 || (__ARM_ARCH == 4 && defined __ARM_ARCH_4T__))
+# define BX(reg) bx reg
+# define BXC(cond, reg) bx##cond reg
+#else
+# define BX(reg) mov pc, reg
+# define BXC(cond, reg) mov##cond pc, reg
+#endif
+
#endif /* _ARM_BX_H */
diff --git a/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
index b01d79c5c..e85aa52fe 100644
--- a/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
@@ -48,6 +48,32 @@
/* only weird assemblers generally need this */
#undef __UCLIBC_ASM_LINE_SEP__
+
+/* The __ARM_ARCH define is provided by gcc 4.8. Construct it otherwise. */
+#ifndef __ARM_ARCH
+# ifdef __ARM_ARCH_2__
+# define __ARM_ARCH 2
+# elif defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__)
+# define __ARM_ARCH 3
+# elif defined (__ARM_ARCH_4__) || defined (__ARM_ARCH_4T__)
+# define __ARM_ARCH 4
+# elif defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5E__) \
+ || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) \
+ || defined(__ARM_ARCH_5TEJ__)
+# define __ARM_ARCH 5
+# elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
+ || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \
+ || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__)
+# define __ARM_ARCH 6
+# elif defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
+ || defined(__ARM_ARCH_7EM__)
+# define __ARM_ARCH 7
+# else
+# error unknown arm architecture
+# endif
+#endif
+
#ifdef __GNUC__
# define __need_uClibc_config_h
# include <bits/uClibc_config.h>