From e71fc570caec4f2d4bbe729dfe9eb41bfe5a732a Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 18 Apr 2015 22:41:46 +0200 Subject: arm: Add BX and BXC macros Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/arm/bits/arm_bx.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux/arm/bits/arm_bx.h') 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 */ -- cgit v1.2.3