--- zzzz-none-000/linux-2.6.39.4/arch/arm/kernel/process.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/arch/arm/kernel/process.c 2021-11-10 13:23:09.000000000 +0000 @@ -38,6 +38,12 @@ #include #include #include +#if IS_ENABLED(CONFIG_AVM_POWERMETER) || IS_ENABLED(CONFIG_AVM_POWER) +#include +#endif +#if defined(CONFIG_AVM_SIMPLE_PROFILING) +#include +#endif/*--- #if defined(CONFIG_AVM_SIMPLE_PROFILING) ---*/ #ifdef CONFIG_CC_STACKPROTECTOR #include @@ -155,15 +161,24 @@ smp_call_function(do_nothing, NULL, 1); } EXPORT_SYMBOL_GPL(cpu_idle_wait); - /* * This is our default idle handler. We need to disable * interrupts here to ensure we don't miss a wakeup call. */ static void default_idle(void) { - if (!need_resched()) - arch_idle(); +#if defined(CONFIG_AVM_SIMPLE_PROFILING) + if(avm_simple_profiling_is_enabled()) { + /*--- perf-cycle-counter stopps in idle ---*/ + local_irq_enable(); + while (!need_resched()) ; + } else +#endif/*--- #else ---*//*--- #if defined(CONFIG_AVM_SIMPLE_PROFILING) ---*/ + if (!need_resched()) + arch_idle(); +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_end(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ local_irq_enable(); } @@ -195,6 +210,9 @@ local_irq_enable(); cpu_relax(); } else { +#if defined(CONFIG_AVM_POWER) + avm_cpu_wait_start(); +#endif/*--- #if defined(CONFIG_AVM_POWER) ---*/ stop_critical_timings(); pm_idle(); start_critical_timings(); @@ -204,9 +222,15 @@ * enabled. */ WARN_ON(irqs_disabled()); +#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) ---*/ leds_event(led_idle_end); tick_nohz_restart_sched_tick(); preempt_enable_no_resched();