x86, mce: unify, prepare for 32-bit v2
[linux-2.6/mini2440.git] / arch / x86 / kernel / cpu / mcheck / mce_32.c
blob05979e7eff1200c04422575e58a767cfc99bc2bc
1 /*
2 * mce.c - x86 Machine Check Exception Reporting
3 * (c) 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>, Dave Jones <davej@redhat.com>
4 */
5 #include <linux/thread_info.h>
6 #include <linux/kernel.h>
7 #include <linux/module.h>
8 #include <linux/types.h>
9 #include <linux/init.h>
10 #include <linux/smp.h>
12 #include <asm/processor.h>
13 #include <asm/system.h>
14 #include <asm/mce.h>
16 #include "mce.h"
18 int mce_disabled;
20 int nr_mce_banks;
21 EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
23 /* Handle unconfigured int18 (should never happen) */
24 static void unexpected_machine_check(struct pt_regs *regs, long error_code)
26 printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
27 smp_processor_id());
30 /* Call the installed machine check handler for this CPU setup. */
31 void (*machine_check_vector)(struct pt_regs *, long error_code) =
32 unexpected_machine_check;
34 /* This has to be run for each processor */
35 void mcheck_init(struct cpuinfo_x86 *c)
37 if (mce_disabled == 1)
38 return;
40 switch (c->x86_vendor) {
41 case X86_VENDOR_AMD:
42 amd_mcheck_init(c);
43 break;
45 case X86_VENDOR_INTEL:
46 if (c->x86 == 5)
47 intel_p5_mcheck_init(c);
48 if (c->x86 == 6)
49 intel_p6_mcheck_init(c);
50 if (c->x86 == 15)
51 intel_p4_mcheck_init(c);
52 break;
54 case X86_VENDOR_CENTAUR:
55 if (c->x86 == 5)
56 winchip_mcheck_init(c);
57 break;
59 default:
60 break;
64 static int __init mcheck_disable(char *str)
66 mce_disabled = 1;
67 return 1;
70 static int __init mcheck_enable(char *str)
72 mce_disabled = -1;
73 return 1;
76 __setup("nomce", mcheck_disable);
77 __setup("mce", mcheck_enable);