OSDN Git Service

ARM: detect BX availibility at build time
authorYann E. MORIN <yann.morin.1998@anciens.enib.fr>
Sun, 9 Jan 2011 00:45:09 +0000 (01:45 +0100)
committerKhem Raj <raj.khem@gmail.com>
Sat, 11 Jun 2011 07:12:22 +0000 (00:12 -0700)
The "use BX" option is now a suggestion that BX be used if available.
Use a macro to detect if BX is available at build time. If so, and
the user requested it be used, then use it. Otherwise, error out.

Macro courtesy Khem RAJ:
  http://lists.uclibc.org/pipermail/uclibc/2009-April/042301.html

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Cc: Khem Raj <raj.khem@gmail.com>
Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
extra/Configs/Config.arm
libc/sysdeps/linux/arm/bits/arm_asm.h

index 4ab7da0..0bb2971 100644 (file)
@@ -33,4 +33,6 @@ config COMPILE_IN_THUMB_MODE
 config USE_BX
        bool "Use BX in function return"
        help
-         Use BX instruction for THUMB aware architectures.
+         Say 'y' to use BX to return from functions on your thumb-aware
+         processor. Say 'y' if you need to use interworking. Say 'n' if not.
+         It is safe to say 'y' even if you're not doing interworking.
index 1d87df6..921c9a3 100644 (file)
 #define THUMB1_ONLY 1
 #endif
 
-#endif /* _ARM_ASM_H */
+#if defined(__USE_BX__)
+# if (   defined (__ARM_ARCH_2__)  || defined (__ARM_ARCH_3__) \
+      || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \
+     )
+#  error Use of BX was requested, but is not available on the target processor.
+# endif /* ARCH level */
+#endif /* __USE_BX__ */
 
+#endif /* _ARM_ASM_H */