diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:17:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-26 17:17:50 -0500 |
commit | 6f8c480f998a619082f18407f8d7f4c29e94dc6e (patch) | |
tree | 5047fe0d685fe9eab64c506fa1001e7df5e65faa /arch/i386 | |
parent | 038c068f63a950c3a6ccfa814831ccac0ad48fb1 (diff) | |
parent | bd5ab26a7d0cc834d846fe5dd7291f0aed3be72b (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] constify some data tables.
[CPUFREQ] constify cpufreq_driver where possible.
{rd,wr}msr_on_cpu SMP=n optimization
[CPUFREQ] cpufreq_ondemand.c: don't use _WORK_NAR
rdmsr_on_cpu, wrmsr_on_cpu
[CPUFREQ] Revert default on deprecated config X86_SPEEDSTEP_CENTRINO_ACPI
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/Kconfig | 1 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/e_powersaver.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/elanfreq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.c | 6 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.h | 26 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longrun.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k6.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k7.c | 6 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/powernow-k8.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/sc520_freq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | 2 | ||||
-rw-r--r-- | arch/i386/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/i386/lib/msr-on-cpu.c | 58 |
16 files changed, 90 insertions, 31 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig index 6c52182ca323..e912aae9473c 100644 --- a/arch/i386/kernel/cpu/cpufreq/Kconfig +++ b/arch/i386/kernel/cpu/cpufreq/Kconfig | |||
@@ -125,7 +125,6 @@ config X86_SPEEDSTEP_CENTRINO_ACPI | |||
125 | bool "Use ACPI tables to decode valid frequency/voltage (deprecated)" | 125 | bool "Use ACPI tables to decode valid frequency/voltage (deprecated)" |
126 | depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR | 126 | depends on X86_SPEEDSTEP_CENTRINO && ACPI_PROCESSOR |
127 | depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m) | 127 | depends on !(X86_SPEEDSTEP_CENTRINO = y && ACPI_PROCESSOR = m) |
128 | default y | ||
129 | help | 128 | help |
130 | This is deprecated and this functionality is now merged into | 129 | This is deprecated and this functionality is now merged into |
131 | acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of | 130 | acpi_cpufreq (X86_ACPI_CPUFREQ). Use that driver instead of |
diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c index 0d49d73d1b71..280b3177edbd 100644 --- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c +++ b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | |||
@@ -373,7 +373,7 @@ static int nforce2_cpu_exit(struct cpufreq_policy *policy) | |||
373 | return 0; | 373 | return 0; |
374 | } | 374 | } |
375 | 375 | ||
376 | static struct cpufreq_driver nforce2_driver = { | 376 | static const struct cpufreq_driver nforce2_driver = { |
377 | .name = "nforce2", | 377 | .name = "nforce2", |
378 | .verify = nforce2_verify, | 378 | .verify = nforce2_verify, |
379 | .target = nforce2_target, | 379 | .target = nforce2_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c index f43d98e11cc7..8bedaad1193b 100644 --- a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c +++ b/arch/i386/kernel/cpu/cpufreq/e_powersaver.c | |||
@@ -293,7 +293,7 @@ static struct freq_attr* eps_attr[] = { | |||
293 | NULL, | 293 | NULL, |
294 | }; | 294 | }; |
295 | 295 | ||
296 | static struct cpufreq_driver eps_driver = { | 296 | static const struct cpufreq_driver eps_driver = { |
297 | .verify = eps_verify, | 297 | .verify = eps_verify, |
298 | .target = eps_target, | 298 | .target = eps_target, |
299 | .init = eps_cpu_init, | 299 | .init = eps_cpu_init, |
diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/i386/kernel/cpu/cpufreq/elanfreq.c index f317276afa7a..6905de3a11e8 100644 --- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c +++ b/arch/i386/kernel/cpu/cpufreq/elanfreq.c | |||
@@ -267,7 +267,7 @@ static struct freq_attr* elanfreq_attr[] = { | |||
267 | }; | 267 | }; |
268 | 268 | ||
269 | 269 | ||
270 | static struct cpufreq_driver elanfreq_driver = { | 270 | static const struct cpufreq_driver elanfreq_driver = { |
271 | .get = elanfreq_get_cpu_frequency, | 271 | .get = elanfreq_get_cpu_frequency, |
272 | .verify = elanfreq_verify, | 272 | .verify = elanfreq_verify, |
273 | .target = elanfreq_target, | 273 | .target = elanfreq_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 6667e9cceb9f..9a66cab7fe14 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | |||
@@ -433,7 +433,7 @@ static int cpufreq_gx_cpu_init(struct cpufreq_policy *policy) | |||
433 | * cpufreq_gx_init: | 433 | * cpufreq_gx_init: |
434 | * MediaGX/Geode GX initialize cpufreq driver | 434 | * MediaGX/Geode GX initialize cpufreq driver |
435 | */ | 435 | */ |
436 | static struct cpufreq_driver gx_suspmod_driver = { | 436 | static const struct cpufreq_driver gx_suspmod_driver = { |
437 | .get = gx_get_cpuspeed, | 437 | .get = gx_get_cpuspeed, |
438 | .verify = cpufreq_gx_verify, | 438 | .verify = cpufreq_gx_verify, |
439 | .target = cpufreq_gx_target, | 439 | .target = cpufreq_gx_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index b59878a0d9b3..8cc6952d7772 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c | |||
@@ -61,8 +61,8 @@ static int cpu_model; | |||
61 | static unsigned int numscales=16; | 61 | static unsigned int numscales=16; |
62 | static unsigned int fsb; | 62 | static unsigned int fsb; |
63 | 63 | ||
64 | static struct mV_pos *vrm_mV_table; | 64 | static const struct mV_pos *vrm_mV_table; |
65 | static unsigned char *mV_vrm_table; | 65 | static const unsigned char *mV_vrm_table; |
66 | struct f_msr { | 66 | struct f_msr { |
67 | u8 vrm; | 67 | u8 vrm; |
68 | u8 pos; | 68 | u8 pos; |
@@ -821,7 +821,7 @@ static struct freq_attr* longhaul_attr[] = { | |||
821 | NULL, | 821 | NULL, |
822 | }; | 822 | }; |
823 | 823 | ||
824 | static struct cpufreq_driver longhaul_driver = { | 824 | static const struct cpufreq_driver longhaul_driver = { |
825 | .verify = longhaul_verify, | 825 | .verify = longhaul_verify, |
826 | .target = longhaul_target, | 826 | .target = longhaul_target, |
827 | .get = longhaul_get, | 827 | .get = longhaul_get, |
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/i386/kernel/cpu/cpufreq/longhaul.h index bb0a04b1d1ab..102548f12842 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.h +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.h | |||
@@ -56,7 +56,7 @@ union msr_longhaul { | |||
56 | /* | 56 | /* |
57 | * VIA C3 Samuel 1 & Samuel 2 (stepping 0) | 57 | * VIA C3 Samuel 1 & Samuel 2 (stepping 0) |
58 | */ | 58 | */ |
59 | static int __initdata samuel1_clock_ratio[16] = { | 59 | static const int __initdata samuel1_clock_ratio[16] = { |
60 | -1, /* 0000 -> RESERVED */ | 60 | -1, /* 0000 -> RESERVED */ |
61 | 30, /* 0001 -> 3.0x */ | 61 | 30, /* 0001 -> 3.0x */ |
62 | 40, /* 0010 -> 4.0x */ | 62 | 40, /* 0010 -> 4.0x */ |
@@ -75,7 +75,7 @@ static int __initdata samuel1_clock_ratio[16] = { | |||
75 | -1, /* 1111 -> RESERVED */ | 75 | -1, /* 1111 -> RESERVED */ |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static int __initdata samuel1_eblcr[16] = { | 78 | static const int __initdata samuel1_eblcr[16] = { |
79 | 50, /* 0000 -> RESERVED */ | 79 | 50, /* 0000 -> RESERVED */ |
80 | 30, /* 0001 -> 3.0x */ | 80 | 30, /* 0001 -> 3.0x */ |
81 | 40, /* 0010 -> 4.0x */ | 81 | 40, /* 0010 -> 4.0x */ |
@@ -97,7 +97,7 @@ static int __initdata samuel1_eblcr[16] = { | |||
97 | /* | 97 | /* |
98 | * VIA C3 Samuel2 Stepping 1->15 | 98 | * VIA C3 Samuel2 Stepping 1->15 |
99 | */ | 99 | */ |
100 | static int __initdata samuel2_eblcr[16] = { | 100 | static const int __initdata samuel2_eblcr[16] = { |
101 | 50, /* 0000 -> 5.0x */ | 101 | 50, /* 0000 -> 5.0x */ |
102 | 30, /* 0001 -> 3.0x */ | 102 | 30, /* 0001 -> 3.0x */ |
103 | 40, /* 0010 -> 4.0x */ | 103 | 40, /* 0010 -> 4.0x */ |
@@ -119,7 +119,7 @@ static int __initdata samuel2_eblcr[16] = { | |||
119 | /* | 119 | /* |
120 | * VIA C3 Ezra | 120 | * VIA C3 Ezra |
121 | */ | 121 | */ |
122 | static int __initdata ezra_clock_ratio[16] = { | 122 | static const int __initdata ezra_clock_ratio[16] = { |
123 | 100, /* 0000 -> 10.0x */ | 123 | 100, /* 0000 -> 10.0x */ |
124 | 30, /* 0001 -> 3.0x */ | 124 | 30, /* 0001 -> 3.0x */ |
125 | 40, /* 0010 -> 4.0x */ | 125 | 40, /* 0010 -> 4.0x */ |
@@ -138,7 +138,7 @@ static int __initdata ezra_clock_ratio[16] = { | |||
138 | 120, /* 1111 -> 12.0x */ | 138 | 120, /* 1111 -> 12.0x */ |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static int __initdata ezra_eblcr[16] = { | 141 | static const int __initdata ezra_eblcr[16] = { |
142 | 50, /* 0000 -> 5.0x */ | 142 | 50, /* 0000 -> 5.0x */ |
143 | 30, /* 0001 -> 3.0x */ | 143 | 30, /* 0001 -> 3.0x */ |
144 | 40, /* 0010 -> 4.0x */ | 144 | 40, /* 0010 -> 4.0x */ |
@@ -160,7 +160,7 @@ static int __initdata ezra_eblcr[16] = { | |||
160 | /* | 160 | /* |
161 | * VIA C3 (Ezra-T) [C5M]. | 161 | * VIA C3 (Ezra-T) [C5M]. |
162 | */ | 162 | */ |
163 | static int __initdata ezrat_clock_ratio[32] = { | 163 | static const int __initdata ezrat_clock_ratio[32] = { |
164 | 100, /* 0000 -> 10.0x */ | 164 | 100, /* 0000 -> 10.0x */ |
165 | 30, /* 0001 -> 3.0x */ | 165 | 30, /* 0001 -> 3.0x */ |
166 | 40, /* 0010 -> 4.0x */ | 166 | 40, /* 0010 -> 4.0x */ |
@@ -196,7 +196,7 @@ static int __initdata ezrat_clock_ratio[32] = { | |||
196 | -1, /* 1111 -> RESERVED (12.0x) */ | 196 | -1, /* 1111 -> RESERVED (12.0x) */ |
197 | }; | 197 | }; |
198 | 198 | ||
199 | static int __initdata ezrat_eblcr[32] = { | 199 | static const int __initdata ezrat_eblcr[32] = { |
200 | 50, /* 0000 -> 5.0x */ | 200 | 50, /* 0000 -> 5.0x */ |
201 | 30, /* 0001 -> 3.0x */ | 201 | 30, /* 0001 -> 3.0x */ |
202 | 40, /* 0010 -> 4.0x */ | 202 | 40, /* 0010 -> 4.0x */ |
@@ -235,7 +235,7 @@ static int __initdata ezrat_eblcr[32] = { | |||
235 | /* | 235 | /* |
236 | * VIA C3 Nehemiah */ | 236 | * VIA C3 Nehemiah */ |
237 | 237 | ||
238 | static int __initdata nehemiah_clock_ratio[32] = { | 238 | static const int __initdata nehemiah_clock_ratio[32] = { |
239 | 100, /* 0000 -> 10.0x */ | 239 | 100, /* 0000 -> 10.0x */ |
240 | 160, /* 0001 -> 16.0x */ | 240 | 160, /* 0001 -> 16.0x */ |
241 | 40, /* 0010 -> 4.0x */ | 241 | 40, /* 0010 -> 4.0x */ |
@@ -270,7 +270,7 @@ static int __initdata nehemiah_clock_ratio[32] = { | |||
270 | 120, /* 1111 -> 12.0x */ | 270 | 120, /* 1111 -> 12.0x */ |
271 | }; | 271 | }; |
272 | 272 | ||
273 | static int __initdata nehemiah_eblcr[32] = { | 273 | static const int __initdata nehemiah_eblcr[32] = { |
274 | 50, /* 0000 -> 5.0x */ | 274 | 50, /* 0000 -> 5.0x */ |
275 | 160, /* 0001 -> 16.0x */ | 275 | 160, /* 0001 -> 16.0x */ |
276 | 40, /* 0010 -> 4.0x */ | 276 | 40, /* 0010 -> 4.0x */ |
@@ -315,7 +315,7 @@ struct mV_pos { | |||
315 | unsigned short pos; | 315 | unsigned short pos; |
316 | }; | 316 | }; |
317 | 317 | ||
318 | static struct mV_pos __initdata vrm85_mV[32] = { | 318 | static const struct mV_pos __initdata vrm85_mV[32] = { |
319 | {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2}, | 319 | {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2}, |
320 | {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26}, | 320 | {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26}, |
321 | {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18}, | 321 | {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18}, |
@@ -326,14 +326,14 @@ static struct mV_pos __initdata vrm85_mV[32] = { | |||
326 | {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11} | 326 | {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11} |
327 | }; | 327 | }; |
328 | 328 | ||
329 | static unsigned char __initdata mV_vrm85[32] = { | 329 | static const unsigned char __initdata mV_vrm85[32] = { |
330 | 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11, | 330 | 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11, |
331 | 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d, | 331 | 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d, |
332 | 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19, | 332 | 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19, |
333 | 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15 | 333 | 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15 |
334 | }; | 334 | }; |
335 | 335 | ||
336 | static struct mV_pos __initdata mobilevrm_mV[32] = { | 336 | static const struct mV_pos __initdata mobilevrm_mV[32] = { |
337 | {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28}, | 337 | {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28}, |
338 | {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24}, | 338 | {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24}, |
339 | {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20}, | 339 | {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20}, |
@@ -344,7 +344,7 @@ static struct mV_pos __initdata mobilevrm_mV[32] = { | |||
344 | {675, 3}, {650, 2}, {625, 1}, {600, 0} | 344 | {675, 3}, {650, 2}, {625, 1}, {600, 0} |
345 | }; | 345 | }; |
346 | 346 | ||
347 | static unsigned char __initdata mV_mobilevrm[32] = { | 347 | static const unsigned char __initdata mV_mobilevrm[32] = { |
348 | 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, | 348 | 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, |
349 | 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, | 349 | 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, |
350 | 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, | 350 | 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, |
diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/i386/kernel/cpu/cpufreq/longrun.c index b2689514295a..e11fd86ce8fb 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/i386/kernel/cpu/cpufreq/longrun.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) | 19 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longrun", msg) |
20 | 20 | ||
21 | static struct cpufreq_driver longrun_driver; | 21 | static const struct cpufreq_driver longrun_driver; |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * longrun_{low,high}_freq is needed for the conversion of cpufreq kHz | 24 | * longrun_{low,high}_freq is needed for the conversion of cpufreq kHz |
@@ -280,7 +280,7 @@ static int __init longrun_cpu_init(struct cpufreq_policy *policy) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | 282 | ||
283 | static struct cpufreq_driver longrun_driver = { | 283 | static const struct cpufreq_driver longrun_driver = { |
284 | .flags = CPUFREQ_CONST_LOOPS, | 284 | .flags = CPUFREQ_CONST_LOOPS, |
285 | .verify = longrun_verify_policy, | 285 | .verify = longrun_verify_policy, |
286 | .setpolicy = longrun_set_policy, | 286 | .setpolicy = longrun_set_policy, |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c index f89524051e4a..2a0d89cb0b4b 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k6.c | |||
@@ -195,7 +195,7 @@ static struct freq_attr* powernow_k6_attr[] = { | |||
195 | NULL, | 195 | NULL, |
196 | }; | 196 | }; |
197 | 197 | ||
198 | static struct cpufreq_driver powernow_k6_driver = { | 198 | static const struct cpufreq_driver powernow_k6_driver = { |
199 | .verify = powernow_k6_verify, | 199 | .verify = powernow_k6_verify, |
200 | .target = powernow_k6_target, | 200 | .target = powernow_k6_target, |
201 | .init = powernow_k6_cpu_init, | 201 | .init = powernow_k6_cpu_init, |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c index 54382760983a..d98529c93a1c 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c | |||
@@ -68,7 +68,7 @@ union powernow_acpi_control_t { | |||
68 | 68 | ||
69 | #ifdef CONFIG_CPU_FREQ_DEBUG | 69 | #ifdef CONFIG_CPU_FREQ_DEBUG |
70 | /* divide by 1000 to get VCore voltage in V. */ | 70 | /* divide by 1000 to get VCore voltage in V. */ |
71 | static int mobile_vid_table[32] = { | 71 | static const int mobile_vid_table[32] = { |
72 | 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, | 72 | 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, |
73 | 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0, | 73 | 1600, 1550, 1500, 1450, 1400, 1350, 1300, 0, |
74 | 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, | 74 | 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, |
@@ -77,7 +77,7 @@ static int mobile_vid_table[32] = { | |||
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | /* divide by 10 to get FID. */ | 79 | /* divide by 10 to get FID. */ |
80 | static int fid_codes[32] = { | 80 | static const int fid_codes[32] = { |
81 | 110, 115, 120, 125, 50, 55, 60, 65, | 81 | 110, 115, 120, 125, 50, 55, 60, 65, |
82 | 70, 75, 80, 85, 90, 95, 100, 105, | 82 | 70, 75, 80, 85, 90, 95, 100, 105, |
83 | 30, 190, 40, 200, 130, 135, 140, 210, | 83 | 30, 190, 40, 200, 130, 135, 140, 210, |
@@ -647,7 +647,7 @@ static struct freq_attr* powernow_table_attr[] = { | |||
647 | NULL, | 647 | NULL, |
648 | }; | 648 | }; |
649 | 649 | ||
650 | static struct cpufreq_driver powernow_driver = { | 650 | static const struct cpufreq_driver powernow_driver = { |
651 | .verify = powernow_verify, | 651 | .verify = powernow_verify, |
652 | .target = powernow_target, | 652 | .target = powernow_target, |
653 | .get = powernow_get, | 653 | .get = powernow_get, |
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c index fe3b67005ebb..8ed7b3af0553 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c | |||
@@ -1305,7 +1305,7 @@ static struct freq_attr* powernow_k8_attr[] = { | |||
1305 | NULL, | 1305 | NULL, |
1306 | }; | 1306 | }; |
1307 | 1307 | ||
1308 | static struct cpufreq_driver cpufreq_amd64_driver = { | 1308 | static const struct cpufreq_driver cpufreq_amd64_driver = { |
1309 | .verify = powernowk8_verify, | 1309 | .verify = powernowk8_verify, |
1310 | .target = powernowk8_target, | 1310 | .target = powernowk8_target, |
1311 | .init = powernowk8_cpu_init, | 1311 | .init = powernowk8_cpu_init, |
diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c index b8fb4b521c62..eddbe04a0841 100644 --- a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c +++ b/arch/i386/kernel/cpu/cpufreq/sc520_freq.c | |||
@@ -138,7 +138,7 @@ static struct freq_attr* sc520_freq_attr[] = { | |||
138 | }; | 138 | }; |
139 | 139 | ||
140 | 140 | ||
141 | static struct cpufreq_driver sc520_freq_driver = { | 141 | static const struct cpufreq_driver sc520_freq_driver = { |
142 | .get = sc520_freq_get_cpu_frequency, | 142 | .get = sc520_freq_get_cpu_frequency, |
143 | .verify = sc520_freq_verify, | 143 | .verify = sc520_freq_verify, |
144 | .target = sc520_freq_target, | 144 | .target = sc520_freq_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c index b425cd3d1838..b94e347f08d3 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | |||
@@ -374,7 +374,7 @@ static struct freq_attr* speedstep_attr[] = { | |||
374 | }; | 374 | }; |
375 | 375 | ||
376 | 376 | ||
377 | static struct cpufreq_driver speedstep_driver = { | 377 | static const struct cpufreq_driver speedstep_driver = { |
378 | .name = "speedstep-ich", | 378 | .name = "speedstep-ich", |
379 | .verify = speedstep_verify, | 379 | .verify = speedstep_verify, |
380 | .target = speedstep_target, | 380 | .target = speedstep_target, |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c index ff0d89806114..d4b7404bf315 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c | |||
@@ -332,7 +332,7 @@ static struct freq_attr* speedstep_attr[] = { | |||
332 | NULL, | 332 | NULL, |
333 | }; | 333 | }; |
334 | 334 | ||
335 | static struct cpufreq_driver speedstep_driver = { | 335 | static const struct cpufreq_driver speedstep_driver = { |
336 | .name = "speedstep-smi", | 336 | .name = "speedstep-smi", |
337 | .verify = speedstep_verify, | 337 | .verify = speedstep_verify, |
338 | .target = speedstep_target, | 338 | .target = speedstep_target, |
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile index d86a548b8d54..22d8ac5815f0 100644 --- a/arch/i386/lib/Makefile +++ b/arch/i386/lib/Makefile | |||
@@ -7,3 +7,5 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \ | |||
7 | bitops.o semaphore.o | 7 | bitops.o semaphore.o |
8 | 8 | ||
9 | lib-$(CONFIG_X86_USE_3DNOW) += mmx.o | 9 | lib-$(CONFIG_X86_USE_3DNOW) += mmx.o |
10 | |||
11 | obj-$(CONFIG_SMP) += msr-on-cpu.o | ||
diff --git a/arch/i386/lib/msr-on-cpu.c b/arch/i386/lib/msr-on-cpu.c new file mode 100644 index 000000000000..1c46bda409ff --- /dev/null +++ b/arch/i386/lib/msr-on-cpu.c | |||
@@ -0,0 +1,58 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/preempt.h> | ||
3 | #include <linux/smp.h> | ||
4 | #include <asm/msr.h> | ||
5 | |||
6 | struct msr_info { | ||
7 | u32 msr_no; | ||
8 | u32 l, h; | ||
9 | }; | ||
10 | |||
11 | static void __rdmsr_on_cpu(void *info) | ||
12 | { | ||
13 | struct msr_info *rv = info; | ||
14 | |||
15 | rdmsr(rv->msr_no, rv->l, rv->h); | ||
16 | } | ||
17 | |||
18 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | ||
19 | { | ||
20 | preempt_disable(); | ||
21 | if (smp_processor_id() == cpu) | ||
22 | rdmsr(msr_no, *l, *h); | ||
23 | else { | ||
24 | struct msr_info rv; | ||
25 | |||
26 | rv.msr_no = msr_no; | ||
27 | smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 0, 1); | ||
28 | *l = rv.l; | ||
29 | *h = rv.h; | ||
30 | } | ||
31 | preempt_enable(); | ||
32 | } | ||
33 | |||
34 | static void __wrmsr_on_cpu(void *info) | ||
35 | { | ||
36 | struct msr_info *rv = info; | ||
37 | |||
38 | wrmsr(rv->msr_no, rv->l, rv->h); | ||
39 | } | ||
40 | |||
41 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | ||
42 | { | ||
43 | preempt_disable(); | ||
44 | if (smp_processor_id() == cpu) | ||
45 | wrmsr(msr_no, l, h); | ||
46 | else { | ||
47 | struct msr_info rv; | ||
48 | |||
49 | rv.msr_no = msr_no; | ||
50 | rv.l = l; | ||
51 | rv.h = h; | ||
52 | smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 0, 1); | ||
53 | } | ||
54 | preempt_enable(); | ||
55 | } | ||
56 | |||
57 | EXPORT_SYMBOL(rdmsr_on_cpu); | ||
58 | EXPORT_SYMBOL(wrmsr_on_cpu); | ||