* Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
* no meaning should be associated with absolute values of these MSRs.
*/
-static unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
+unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
{
struct cpufreq_policy *policy;
struct perf_pair readin, cur, *saved;
#endif
- retval = drv_data[policy->cpu]->max_freq * perf_percent / 100;
+ retval = policy->cpuinfo.max_freq * perf_percent / 100;
return retval;
}
policy->governor = cpufreq_opt_governor ? : CPUFREQ_DEFAULT_GOVERNOR;
- data->max_freq = perf->states[0].core_frequency * 1000;
/* table init */
for (i=0; i<perf->state_count; i++) {
if (i>0 && perf->states[i].core_frequency >=
#include <acpi/acpi.h>
#include <acpi/cpufreq/cpufreq.h>
+#define CPUID_6_ECX_APERFMPERF_CAPABILITY (0x1)
#define CPUID_FREQ_VOLT_CAPABILITIES 0x80000007
#define CPB_CAPABLE 0x00000200
#define USE_HW_PSTATE 0x00000080
static struct powernow_cpufreq_data *drv_data[NR_CPUS];
+static struct cpufreq_driver powernow_cpufreq_driver;
+
struct drv_cmd {
unsigned int type;
cpumask_t mask;
if (c->cpuid_level >= 6) {
unsigned int edx;
+ unsigned int ecx;
+ ecx = cpuid_ecx(6);
+ if (ecx & CPUID_6_ECX_APERFMPERF_CAPABILITY)
+ powernow_cpufreq_driver.getavg = get_measured_perf;
edx = cpuid_edx(CPUID_FREQ_VOLT_CAPABILITIES);
if ((edx & CPB_CAPABLE) == CPB_CAPABLE) {
policy->turbo = CPUFREQ_TURBO_ENABLED;
struct acpi_cpufreq_data {
struct processor_performance *acpi_data;
struct cpufreq_frequency_table *freq_table;
- unsigned int max_freq;
unsigned int cpu_feature;
};
int get_cpu_id(u8);
int powernow_cpufreq_init(void);
unsigned int powernow_register_driver(void);
+unsigned int get_measured_perf(unsigned int cpu, unsigned int flag);
void cpufreq_residency_update(unsigned int, uint8_t);
void cpufreq_statistic_update(unsigned int, uint8_t, uint8_t);
int cpufreq_statistic_init(unsigned int);