diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-04-08 06:31:24 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-28 12:24:11 -0400 |
commit | ba2d0f2b0c56d7174a0208f7c463271f39040728 (patch) | |
tree | d08c3297c7f644ce70952f0bf1ff2ff023d174a3 /arch | |
parent | b659294b779565c60f5e12ef505328e2b974eb62 (diff) |
x86, mce: Cleanup symbols in intel thermal codes
Decode magic constants and turn them into symbols.
[ Cleanup to use symbols already exists - HS ]
[ Impact: cleanup ]
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/msr-index.h | 7 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_intel.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_intel_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/p4.c | 2 |
4 files changed, 14 insertions, 6 deletions
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index ec41fc16c167..c86404695083 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h | |||
@@ -208,7 +208,14 @@ | |||
208 | 208 | ||
209 | #define MSR_IA32_THERM_CONTROL 0x0000019a | 209 | #define MSR_IA32_THERM_CONTROL 0x0000019a |
210 | #define MSR_IA32_THERM_INTERRUPT 0x0000019b | 210 | #define MSR_IA32_THERM_INTERRUPT 0x0000019b |
211 | |||
212 | #define THERM_INT_LOW_ENABLE (1 << 0) | ||
213 | #define THERM_INT_HIGH_ENABLE (1 << 1) | ||
214 | |||
211 | #define MSR_IA32_THERM_STATUS 0x0000019c | 215 | #define MSR_IA32_THERM_STATUS 0x0000019c |
216 | |||
217 | #define THERM_STATUS_PROCHOT (1 << 0) | ||
218 | |||
212 | #define MSR_IA32_MISC_ENABLE 0x000001a0 | 219 | #define MSR_IA32_MISC_ENABLE 0x000001a0 |
213 | 220 | ||
214 | /* MISC_ENABLE bits: architectural */ | 221 | /* MISC_ENABLE bits: architectural */ |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c index bad3cbb0e566..2b011d2d8579 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c | |||
@@ -32,13 +32,13 @@ void intel_init_thermal(struct cpuinfo_x86 *c) | |||
32 | */ | 32 | */ |
33 | rdmsr(MSR_IA32_MISC_ENABLE, l, h); | 33 | rdmsr(MSR_IA32_MISC_ENABLE, l, h); |
34 | h = apic_read(APIC_LVTTHMR); | 34 | h = apic_read(APIC_LVTTHMR); |
35 | if ((l & (1 << 3)) && (h & APIC_DM_SMI)) { | 35 | if ((l & MSR_IA32_MISC_ENABLE_TM1) && (h & APIC_DM_SMI)) { |
36 | printk(KERN_DEBUG | 36 | printk(KERN_DEBUG |
37 | "CPU%d: Thermal monitoring handled by SMI\n", cpu); | 37 | "CPU%d: Thermal monitoring handled by SMI\n", cpu); |
38 | return; | 38 | return; |
39 | } | 39 | } |
40 | 40 | ||
41 | if (cpu_has(c, X86_FEATURE_TM2) && (l & (1 << 13))) | 41 | if (cpu_has(c, X86_FEATURE_TM2) && (l & MSR_IA32_MISC_ENABLE_TM2)) |
42 | tm2 = 1; | 42 | tm2 = 1; |
43 | 43 | ||
44 | /* Check whether a vector already exists */ | 44 | /* Check whether a vector already exists */ |
@@ -54,12 +54,13 @@ void intel_init_thermal(struct cpuinfo_x86 *c) | |||
54 | apic_write(APIC_LVTTHMR, h); | 54 | apic_write(APIC_LVTTHMR, h); |
55 | 55 | ||
56 | rdmsr(MSR_IA32_THERM_INTERRUPT, l, h); | 56 | rdmsr(MSR_IA32_THERM_INTERRUPT, l, h); |
57 | wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h); | 57 | wrmsr(MSR_IA32_THERM_INTERRUPT, |
58 | l | (THERM_INT_LOW_ENABLE | THERM_INT_HIGH_ENABLE), h); | ||
58 | 59 | ||
59 | intel_set_thermal_handler(); | 60 | intel_set_thermal_handler(); |
60 | 61 | ||
61 | rdmsr(MSR_IA32_MISC_ENABLE, l, h); | 62 | rdmsr(MSR_IA32_MISC_ENABLE, l, h); |
62 | wrmsr(MSR_IA32_MISC_ENABLE, l | (1 << 3), h); | 63 | wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h); |
63 | 64 | ||
64 | /* Unmask the thermal vector: */ | 65 | /* Unmask the thermal vector: */ |
65 | l = apic_read(APIC_LVTTHMR); | 66 | l = apic_read(APIC_LVTTHMR); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c index 38f9632306fa..13abafcb72e4 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel_64.c | |||
@@ -29,7 +29,7 @@ asmlinkage void smp_thermal_interrupt(void) | |||
29 | irq_enter(); | 29 | irq_enter(); |
30 | 30 | ||
31 | rdmsrl(MSR_IA32_THERM_STATUS, msr_val); | 31 | rdmsrl(MSR_IA32_THERM_STATUS, msr_val); |
32 | if (therm_throt_process(msr_val & 1)) | 32 | if (therm_throt_process(msr_val & THERM_STATUS_PROCHOT)) |
33 | mce_log_therm_throt_event(msr_val); | 33 | mce_log_therm_throt_event(msr_val); |
34 | 34 | ||
35 | inc_irq_stat(irq_thermal_count); | 35 | inc_irq_stat(irq_thermal_count); |
diff --git a/arch/x86/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c index f979ffea330b..82cee108a2d3 100644 --- a/arch/x86/kernel/cpu/mcheck/p4.c +++ b/arch/x86/kernel/cpu/mcheck/p4.c | |||
@@ -51,7 +51,7 @@ static void intel_thermal_interrupt(struct pt_regs *regs) | |||
51 | ack_APIC_irq(); | 51 | ack_APIC_irq(); |
52 | 52 | ||
53 | rdmsrl(MSR_IA32_THERM_STATUS, msr_val); | 53 | rdmsrl(MSR_IA32_THERM_STATUS, msr_val); |
54 | therm_throt_process(msr_val & 0x1); | 54 | therm_throt_process(msr_val & THERM_STATUS_PROCHOT); |
55 | } | 55 | } |
56 | 56 | ||
57 | /* Thermal interrupt handler for this CPU setup: */ | 57 | /* Thermal interrupt handler for this CPU setup: */ |