Define a WFI macro that expands to the right form of wait-for-interrupt

depending on the architecture.
This commit is contained in:
Ian Lepore 2015-01-01 23:18:37 +00:00
parent bd96d0895e
commit 54f9ec883d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276519
3 changed files with 5 additions and 1 deletions

View File

@ -461,7 +461,7 @@ ENTRY_NP(cpu_halt)
teq r4, #0
movne pc, r4
1:
wfi
WFI
b 1b
/*

View File

@ -227,14 +227,17 @@
#define ISB isb
#define DSB dsb
#define DMB dmb
#define WFI wfi
#elif __ARM_ARCH == 6
#define ISB mcr CP15_CP15ISB
#define DSB mcr CP15_CP15DSB
#define DMB mcr CP15_CP15DMB
#define WFI mcr CP15_CP15WFI
#else
#define ISB mcr CP15_CP15ISB
#define DSB mcr CP15_CP15DSB /* DSB and DMB are the */
#define DMB mcr CP15_CP15DSB /* same prior to v6.*/
/* No form of WFI available on v4, define nothing to get an error on use. */
#endif
#endif /* !_MACHINE_ASM_H_ */

View File

@ -166,6 +166,7 @@
/* Only ARMv6: */
#define CP15_CP15DSB p15, 0, r0, c7, c10, 4 /* DSB */
#define CP15_CP15DMB p15, 0, r0, c7, c10, 5 /* DMB */
#define CP15_CP15WFI p15, 0, r0, c7, c0, 4 /* WFI */
#endif
#if __ARM_ARCH >= 7