diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-09 16:45:55 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-09 16:45:55 +0000 |
commit | 601293a4989f47edbf941b355d640e03540a8f86 (patch) | |
tree | 1ee537e3691c843fa9d669f2c5907127298e65fd /sys/arm/include/asm.h | |
parent | 527c39f49b0bd10e54d2ac823e801c7dfb36e3c8 (diff) | |
download | FreeBSD-src-601293a4989f47edbf941b355d640e03540a8f86.zip FreeBSD-src-601293a4989f47edbf941b355d640e03540a8f86.tar.gz |
Import a RET macro, that will use bx if the arch supports it.
Obtained from: NetBSD
Diffstat (limited to 'sys/arm/include/asm.h')
-rw-r--r-- | sys/arm/include/asm.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/arm/include/asm.h b/sys/arm/include/asm.h index 31ab40b..db8b825 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_ */ |