aboutsummaryrefslogtreecommitdiff
path: root/sys/arm
diff options
context:
space:
mode:
authorOlivier Houchard <cognet@FreeBSD.org>2004-11-09 16:45:55 +0000
committerOlivier Houchard <cognet@FreeBSD.org>2004-11-09 16:45:55 +0000
commit5f2c6402db975258c3542b04b500b554986d4ebb (patch)
tree1ee537e3691c843fa9d669f2c5907127298e65fd /sys/arm
parent904e5ace47a075cde32d15f96bf79fa40dca84b7 (diff)
downloadsrc-5f2c6402db975258c3542b04b500b554986d4ebb.tar.gz
src-5f2c6402db975258c3542b04b500b554986d4ebb.zip
Import a RET macro, that will use bx if the arch supports it.
Obtained from: NetBSD
Notes
Notes: svn path=/head/; revision=137462
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/include/asm.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/arm/include/asm.h b/sys/arm/include/asm.h
index 31ab40bff750..db8b8258142c 100644
--- a/sys/arm/include/asm.h
+++ b/sys/arm/include/asm.h
@@ -139,4 +139,40 @@
.stabs __STRING(_/**/sym),1,0,0,0
#endif /* __STDC__ */
+
+#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__)
+#define _ARM_ARCH_6
+#endif
+
+#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5__) || \
+ defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5TE__) || \
+ defined (__ARM_ARCH_5TEJ__)
+#define _ARM_ARCH_5
+#endif
+
+#if defined (_ARM_ARCH_5) || defined (__ARM_ARCH_4T__)
+#define _ARM_ARCH_4T
+#endif
+
+
+#if defined (_ARM_ARCH_4T)
+# define RET bx lr
+# define RETeq bxeq lr
+# define RETne bxne lr
+# ifdef __STDC__
+# define RETc(c) bx##c lr
+# else
+# define RETc(c) bx/**/c lr
+# endif
+#else
+# define RET mov pc, lr
+# define RETeq moveq pc, lr
+# define RETne movne pc, lr
+# ifdef __STDC__
+# define RETc(c) mov##c pc, lr
+# else
+# define RETc(c) mov/**/c pc, lr
+# endif
+#endif
+
#endif /* !_MACHINE_ASM_H_ */