static int cpufreq_get_cur_state(unsigned int cpu) { if (!cpu_has_cpufreq(cpu)) return 0; return reduction_pctg(cpu); }
static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb, unsigned long event, void *data) { struct cpufreq_policy *policy = data; unsigned long max_freq = 0; if (event != CPUFREQ_ADJUST) goto out; max_freq = ( policy->cpuinfo.max_freq * (100 - reduction_pctg(policy->cpu) * 20) ) / 100; cpufreq_verify_within_limits(policy, 0, max_freq); out: return 0; }
static int cpufreq_set_cur_state(unsigned int cpu, int state) { int i; if (!cpu_has_cpufreq(cpu)) return 0; reduction_pctg(cpu) = state; /* * Update all the CPUs in the same package because they all * contribute to the temperature and often share the same * frequency. */ for_each_online_cpu(i) { if (topology_physical_package_id(i) == topology_physical_package_id(cpu)) cpufreq_update_policy(i); } return 0; }
static int cpufreq_set_cur_state(unsigned int cpu, int state) { int i; if (!cpu_has_cpufreq(cpu)) return 0; reduction_pctg(cpu) = state; /* */ for_each_online_cpu(i) { if (topology_physical_package_id(i) == topology_physical_package_id(cpu)) cpufreq_update_policy(i); } return 0; }