aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-13 00:19:50 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-03-13 00:19:50 -0400
commit7ad728f98162cb1af06a85b2a5fc422dddd4fb78 (patch)
tree85a326e35ff5d37d89aa7a687a623cded6fcb190 /arch/x86/kernel/cpu/cpufreq/powernow-k8.c
parentfcef8576d8a64fc603e719c97d423f9f6d4e0e8b (diff)
cpumask: x86: convert cpu_sibling_map/cpu_core_map to cpumask_var_t
Impact: reduce per-cpu size for CONFIG_CPUMASK_OFFSTACK=y In most places it's cleaner to use the accessors cpu_sibling_mask() and cpu_core_mask() wrappers which already exist. I couldn't avoid cleaning up the access in oprofile, either. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/x86/kernel/cpu/cpufreq/powernow-k8.c')
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 6428aa17b40e..e8fd76f98883 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -56,7 +56,10 @@ static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data);
56static int cpu_family = CPU_OPTERON; 56static int cpu_family = CPU_OPTERON;
57 57
58#ifndef CONFIG_SMP 58#ifndef CONFIG_SMP
59DEFINE_PER_CPU(cpumask_t, cpu_core_map); 59static inline const struct cpumask *cpu_core_mask(int cpu)
60{
61 return cpumask_of(0);
62}
60#endif 63#endif
61 64
62/* Return a frequency in MHz, given an input fid */ 65/* Return a frequency in MHz, given an input fid */
@@ -654,7 +657,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, struct pst_s *pst,
654 657
655 dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid); 658 dprintk("cfid 0x%x, cvid 0x%x\n", data->currfid, data->currvid);
656 data->powernow_table = powernow_table; 659 data->powernow_table = powernow_table;
657 if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu) 660 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
658 print_basics(data); 661 print_basics(data);
659 662
660 for (j = 0; j < data->numps; j++) 663 for (j = 0; j < data->numps; j++)
@@ -808,7 +811,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
808 811
809 /* fill in data */ 812 /* fill in data */
810 data->numps = data->acpi_data.state_count; 813 data->numps = data->acpi_data.state_count;
811 if (first_cpu(per_cpu(cpu_core_map, data->cpu)) == data->cpu) 814 if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu)
812 print_basics(data); 815 print_basics(data);
813 powernow_k8_acpi_pst_values(data, 0); 816 powernow_k8_acpi_pst_values(data, 0);
814 817
@@ -1224,7 +1227,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1224 if (cpu_family == CPU_HW_PSTATE) 1227 if (cpu_family == CPU_HW_PSTATE)
1225 cpumask_copy(pol->cpus, cpumask_of(pol->cpu)); 1228 cpumask_copy(pol->cpus, cpumask_of(pol->cpu));
1226 else 1229 else
1227 cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu)); 1230 cpumask_copy(pol->cpus, cpu_core_mask(pol->cpu));
1228 data->available_cores = pol->cpus; 1231 data->available_cores = pol->cpus;
1229 1232
1230 if (cpu_family == CPU_HW_PSTATE) 1233 if (cpu_family == CPU_HW_PSTATE)
@@ -1286,7 +1289,7 @@ static unsigned int powernowk8_get (unsigned int cpu)
1286 unsigned int khz = 0; 1289 unsigned int khz = 0;
1287 unsigned int first; 1290 unsigned int first;
1288 1291
1289 first = first_cpu(per_cpu(cpu_core_map, cpu)); 1292 first = cpumask_first(cpu_core_mask(cpu));
1290 data = per_cpu(powernow_data, first); 1293 data = per_cpu(powernow_data, first);
1291 1294
1292 if (!data) 1295 if (!data)