--- zzzz-none-000/linux-2.6.28.10/arch/mips/kernel/process.c 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/arch/mips/kernel/process.c 2014-01-08 16:27:17.000000000 +0000 @@ -42,7 +42,16 @@ #include #include #include +#if defined(CONFIG_AVM_POWER) +#include +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ +#if defined(CONFIG_AVM_SIMPLE_PROFILING) +#include +#endif/*--- #if defined(CONFIG_AVM_SIMPLE_PROFILING) ---*/ + +void (*pm_idle)(void) = NULL; +EXPORT_SYMBOL(pm_idle); /* * The idle thread. There's no useful work to be done, so just try to conserve * power and have a low exit latency (ie sit in a loop waiting for somebody to @@ -54,14 +63,27 @@ while (1) { tick_nohz_stop_sched_tick(1); while (!need_resched()) { +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_start(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ #ifdef CONFIG_MIPS_MT_SMTC extern void smtc_idle_loop_hook(void); smtc_idle_loop_hook(); #endif - if (cpu_wait) + if (pm_idle) + (*pm_idle)(); + + if (cpu_wait) { (*cpu_wait)(); + } +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_end(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ } +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_info(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ tick_nohz_restart_sched_tick(); preempt_enable_no_resched(); schedule(); @@ -104,7 +126,7 @@ { struct thread_info *ti = task_thread_info(p); struct pt_regs *childregs; - long childksp; + unsigned long childksp; p->set_child_tid = p->clear_child_tid = NULL; childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32; @@ -121,6 +143,7 @@ /* set up new TSS. */ childregs = (struct pt_regs *) childksp - 1; + childksp = (unsigned long) childregs; *childregs = *regs; childregs->regs[7] = 0; /* Clear error flag */