X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=arch%2Favr32%2Fkernel%2Fprocess.c;h=4f8d2d4747406d0aa4210d50a40424324adcc6d8;hb=19b7ce8bad718a2850ea19aeb7383f1728596c24;hp=317dc50945f231896ca079f382eebbfe67201cb4;hpb=c730f5b621afa33e9f4939da9078669162ebff4e;p=linux-2.6 diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 317dc50945..4f8d2d4747 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c @@ -19,6 +19,8 @@ void (*pm_power_off)(void) = NULL; EXPORT_SYMBOL(pm_power_off); +extern void cpu_idle_sleep(void); + /* * This file handles the architecture-dependent parts of process handling.. */ @@ -27,9 +29,8 @@ void cpu_idle(void) { /* endless idle loop with no priority at all */ while (1) { - /* TODO: Enter sleep mode */ while (!need_resched()) - cpu_relax(); + cpu_idle_sleep(); preempt_enable_no_resched(); schedule(); preempt_disable(); @@ -38,6 +39,13 @@ void cpu_idle(void) void machine_halt(void) { + /* + * Enter Stop mode. The 32 kHz oscillator will keep running so + * the RTC will keep the time properly and the system will + * boot quickly. + */ + asm volatile("sleep 3\n\t" + "sub pc, -2"); } void machine_power_off(void)