--- zzzz-none-000/linux-4.4.271/arch/mips/kernel/idle.c 2021-06-03 06:22:09.000000000 +0000 +++ maple-fsgw-759/linux-4.4.271/arch/mips/kernel/idle.c 2023-12-20 10:37:03.000000000 +0000 @@ -21,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, @@ -49,7 +52,13 @@ void r4k_wait(void) { local_irq_enable(); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_start(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ __r4k_wait(); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_info(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ } /* @@ -61,13 +70,22 @@ */ 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 arch=r4000 \n" + " .set "MIPS_ISA_ARCH_LEVEL" \n" " wait \n" " .set pop \n"); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_end(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ local_irq_enable(); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_info(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ } /* @@ -79,7 +97,7 @@ if (!need_resched()) __asm__( " .set push \n" - " .set arch=r4000 \n" + " .set "MIPS_ISA_ARCH_LEVEL" \n" " .set noat \n" " mfc0 $1, $12 \n" " sync \n" @@ -100,7 +118,7 @@ unsigned long c0status = read_c0_status() | 1; /* irqs on */ __asm__( - " .set arch=r4000 \n" + " .set "MIPS_ISA_ARCH_LEVEL" \n" " cache 0x14, 0(%0) \n" " cache 0x14, 32(%0) \n" " sync \n"