From d6df6607425f170ac601ba3559ea253fed4f0511 Mon Sep 17 00:00:00 2001 From: Tim Deegan Date: Tue, 13 Mar 2012 15:11:00 +0000 Subject: [PATCH] arm: Put the CPU into a sleep state in the idle loop The ARM doesn't actually say that the WFI instruction will return immediately if CPSR.I is clear and an instruction is pending, but this seems to match up with how linux uses it. Signed-off-by: Tim Deegan Committed-by: Ian Campbell --- xen/arch/arm/domain.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index e1d500df5c..edaff2252a 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -34,7 +34,11 @@ void idle_loop(void) if ( cpu_is_offline(smp_processor_id()) ) stop_cpu(); - /* TODO: (*pm_idle)(); */ + local_irq_disable(); + if ( cpu_is_haltable(smp_processor_id()) ) + asm volatile ("dsb; wfi"); + local_irq_enable(); + do_tasklet(); do_softirq(); } -- 2.30.2