powerpc/microwatt: Define an idle power-save function
This uses the 'wait' instruction to pause instruction execution when idle until an interrupt occurs. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/Z5xtl1m_Gqc-HLjY@thinks.paulus.ozlabs.org
This commit is contained in:
committed by
Madhavan Srinivasan
parent
78099fe1e3
commit
2b0a438d53
@@ -34,10 +34,19 @@ static void __init microwatt_setup_arch(void)
|
||||
microwatt_rng_init();
|
||||
}
|
||||
|
||||
static void microwatt_idle(void)
|
||||
{
|
||||
if (!prep_irq_for_idle_irqsoff())
|
||||
return;
|
||||
|
||||
__asm__ __volatile__ ("wait");
|
||||
}
|
||||
|
||||
define_machine(microwatt) {
|
||||
.name = "microwatt",
|
||||
.compatible = "microwatt-soc",
|
||||
.init_IRQ = microwatt_init_IRQ,
|
||||
.setup_arch = microwatt_setup_arch,
|
||||
.progress = udbg_progress,
|
||||
.power_save = microwatt_idle,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user