Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/include/asm.h
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | #if defined (_HAVE_ARMv6_INSTRUCTIONS) || defined (__ARM_ARCH_5TE__) || \ | ||||
defined (__ARM_ARCH_5TEJ__) || defined (__ARM_ARCH_5E__) | defined (__ARM_ARCH_5TEJ__) || defined (__ARM_ARCH_5E__) | ||||
#define _ARM_ARCH_5E | #define _ARM_ARCH_5E | ||||
#define _HAVE_ARMv5E_INSTRUCTIONS 1 | #define _HAVE_ARMv5E_INSTRUCTIONS 1 | ||||
#endif | #endif | ||||
#if defined (_HAVE_ARMv5E_INSTRUCTIONS) || defined (__ARM_ARCH_5__) || \ | #if defined (_HAVE_ARMv5E_INSTRUCTIONS) || defined (__ARM_ARCH_5__) || \ | ||||
defined (__ARM_ARCH_5T__) | defined (__ARM_ARCH_5T__) | ||||
#define _ARM_ARCH_5 | #define _ARM_ARCH_5 | ||||
#define _HAVE_ARMv5_INSTRUCTIONS 1 | |||||
#endif | |||||
#if defined (_HAVE_ARMv5_INSTRUCTIONS) || defined (__ARM_ARCH_4T__) | |||||
#define _ARM_ARCH_4T | |||||
#define _HAVE_ARMv4T_INSTRUCTIONS 1 | |||||
#endif | |||||
/* FreeBSD requires ARMv4, so this is always set. */ | |||||
#define _HAVE_ARMv5_INSTRUCTIONS 1 | #define _HAVE_ARMv4_INSTRUCTIONS 1 | ||||
#endif | |||||
#if defined (_HAVE_ARMv4T_INSTRUCTIONS) | |||||
#if defined (_HAVE_ARMv5_INSTRUCTIONS) || defined (__ARM_ARCH_4T__) | # define RET bx lr | ||||
#define _ARM_ARCH_4T | # define RETeq bxeq lr | ||||
#define _HAVE_ARMv4T_INSTRUCTIONS 1 | # define RETne bxne lr | ||||
#endif | # define RETc(c) bx##c lr | ||||
#else | |||||
/* FreeBSD requires ARMv4, so this is always set. */ | # define RET mov pc, lr | ||||
#define _HAVE_ARMv4_INSTRUCTIONS 1 | # define RETeq moveq pc, lr | ||||
# define RETne movne pc, lr | |||||
#if defined (_HAVE_ARMv4T_INSTRUCTIONS) | # define RETc(c) mov##c pc, lr | ||||
# define RET bx lr | #endif | ||||
# define RETeq bxeq lr | |||||
# define RETne bxne lr | #if __ARM_ARCH >= 7 | ||||
# define RETc(c) bx##c lr | #define ISB isb | ||||
#else | #define DSB dsb | ||||
# define RET mov pc, lr | #define DMB dmb | ||||
# define RETeq moveq pc, lr | #define WFI wfi | ||||
# define RETne movne pc, lr | |||||
# define RETc(c) mov##c pc, lr | #if defined(__ARM_ARCH_7VE__) || defined(__clang__) | ||||
#endif | #define MSR_ELR_HYP(regnum) msr elr_hyp, lr | ||||
#define ERET eret | |||||
#if __ARM_ARCH >= 7 | #else | ||||
#define ISB isb | #define MSR_ELR_HYP(regnum) .word (0xe12ef300 | regnum) | ||||
#define DSB dsb | #define ERET .word 0xe160006e | ||||
#define DMB dmb | #endif | ||||
#define WFI wfi | |||||
#elif __ARM_ARCH == 6 | #elif __ARM_ARCH == 6 | ||||
#define ISB mcr CP15_CP15ISB | #define ISB mcr CP15_CP15ISB | ||||
#define DSB mcr CP15_CP15DSB | #define DSB mcr CP15_CP15DSB | ||||
#define DMB mcr CP15_CP15DMB | #define DMB mcr CP15_CP15DMB | ||||
#define WFI mcr CP15_CP15WFI | #define WFI mcr CP15_CP15WFI | ||||
#else | #else | ||||
#define ISB mcr CP15_CP15ISB | #define ISB mcr CP15_CP15ISB | ||||
#define DSB mcr CP15_CP15DSB /* DSB and DMB are the */ | #define DSB mcr CP15_CP15DSB /* DSB and DMB are the */ | ||||
#define DMB mcr CP15_CP15DSB /* same prior to v6.*/ | #define DMB mcr CP15_CP15DSB /* same prior to v6.*/ | ||||
/* No form of WFI available on v4, define nothing to get an error on use. */ | /* No form of WFI available on v4, define nothing to get an error on use. */ | ||||
#endif | #endif | ||||
#endif /* !_MACHINE_ASM_H_ */ | #endif /* !_MACHINE_ASM_H_ */ |