--- zzzz-none-000/linux-3.10.107/arch/mips/kernel/idle.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/arch/mips/kernel/idle.c 2021-11-10 11:53:54.000000000 +0000 @@ -11,6 +11,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ +#include #include #include #include @@ -20,6 +21,9 @@ #include #include #include +#ifdef CONFIG_AVM_POWER +#include +#endif/*--- #ifdef CONFIG_AVM_POWER ---*/ /* * Not all of the MIPS CPUs have the "wait" instruction available. Moreover, @@ -48,6 +52,9 @@ void r4k_wait(void) { local_irq_enable(); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_start(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ __r4k_wait(); } @@ -60,16 +67,28 @@ */ void r4k_wait_irqoff(void) { +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_start(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ + if (!need_resched()) __asm__( " .set push \n" " .set mips3 \n" " wait \n" " .set pop \n"); + +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_end(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ + local_irq_enable(); __asm__( " .globl __pastwait \n" "__pastwait: \n"); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_info(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ } /* @@ -182,6 +201,11 @@ case CPU_24K: case CPU_34K: case CPU_1004K: + case CPU_1074K: + case CPU_PROAPTIV: + case CPU_P5600: + case CPU_INTERAPTIV: + case CPU_M5150: cpu_wait = r4k_wait; if (read_c0_config7() & MIPS_CONF7_WII) cpu_wait = r4k_wait_irqoff; @@ -235,7 +259,7 @@ #endif } -void arch_cpu_idle(void) +static void mips_cpu_idle(void) { smtc_idle_hook(); if (cpu_wait) @@ -243,3 +267,20 @@ else local_irq_enable(); } + +void arch_cpu_idle(void) +{ + if (cpuidle_idle_call()) + mips_cpu_idle(); +} + +#ifdef CONFIG_CPU_IDLE + +int mips_cpuidle_wait_enter(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int index) +{ + mips_cpu_idle(); + return index; +} + +#endif