arm: Use WFI instruction for arch_cpu_idle function

According to the ​ARMv7 Reference Manual, "Wait for Interrupt" is supported only through the WFI instruction on ARMv7.
The currently used ARMv6 equivalent may not work on ARMv7 and newer CPUs.

Fixes #18520

Change-Id: I69a136870654be33c0c789004e08bf610db3dd97
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8044
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Adam Słaboń
2024-08-17 19:58:48 +00:00
committed by waddlesplash
parent feff791acc
commit d0309c67cb
+2 -3
View File
@@ -14,6 +14,7 @@
#define isb() __asm__ __volatile__("isb" : : : "memory")
#define dsb() __asm__ __volatile__("dsb" : : : "memory")
#define dmb() __asm__ __volatile__("dmb" : : : "memory")
#define wfi() __asm__ __volatile__("wfi" : : : "memory")
#define set_ac()
#define clear_ac()
@@ -122,9 +123,7 @@ arch_cpu_pause(void)
static inline void
arch_cpu_idle(void)
{
uint32 Rd = 0;
asm volatile("mcr p15, 0, %[c7format], c7, c0, 4"
: : [c7format] "r" (Rd) );
wfi();
}