Define _ARM_ARCH_6, _ARM_ARCH_5 and _ARM_ARCH_4T, based on
architecture defines passed from the compiler. Define RET and RETc macros for return and conditional return. If BX is available in the current instruction set then make use of it. Note: these really are from the compiler's -march/-mcpu flags, not from the kernel config, so they can be relied on in user space.
This commit is contained in:
parent
a64bc9e882
commit
0765a88c26
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: asm.h,v 1.5 2003/08/07 16:26:53 agc Exp $ */
|
/* $NetBSD: asm.h,v 1.6 2004/08/21 10:59:41 rearnsha Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1990 The Regents of the University of California.
|
* Copyright (c) 1990 The Regents of the University of California.
|
||||||
|
@ -126,4 +126,35 @@
|
||||||
.stabs __STRING(_/**/sym),1,0,0,0
|
.stabs __STRING(_/**/sym),1,0,0,0
|
||||||
#endif /* __STDC__ */
|
#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
|
||||||
|
# ifdef __STDC__
|
||||||
|
# define RETc(c) bx##c lr
|
||||||
|
# else
|
||||||
|
# define RETc(c) bx/**/c lr
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define RET mov pc, lr
|
||||||
|
# ifdef __STDC__
|
||||||
|
# define RETc(c) mov##c pc, lr
|
||||||
|
# else
|
||||||
|
# define RETc(c) mov/**/c pc, lr
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* !_ARM_ASM_H_ */
|
#endif /* !_ARM_ASM_H_ */
|
||||||
|
|
Loading…
Reference in New Issue