mce_32.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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>
  11. #include <asm/processor.h>
  12. #include <asm/system.h>
  13. #include <asm/mce.h>
  14. #include "mce.h"
  15. int mce_disabled;
  16. int nr_mce_banks;
  17. EXPORT_SYMBOL_GPL(nr_mce_banks); /* non-fatal.o */
  18. /* Handle unconfigured int18 (should never happen) */
  19. static void unexpected_machine_check(struct pt_regs *regs, long error_code)
  20. {
  21. printk(KERN_ERR "CPU#%d: Unexpected int18 (Machine Check).\n",
  22. smp_processor_id());
  23. }
  24. /* Call the installed machine check handler for this CPU setup. */
  25. void (*machine_check_vector)(struct pt_regs *, long error_code) =
  26. unexpected_machine_check;
  27. /* This has to be run for each processor */
  28. void mcheck_init(struct cpuinfo_x86 *c)
  29. {
  30. if (mce_disabled == 1)
  31. return;
  32. switch (c->x86_vendor) {
  33. case X86_VENDOR_AMD:
  34. amd_mcheck_init(c);
  35. break;
  36. case X86_VENDOR_INTEL:
  37. if (c->x86 == 5)
  38. intel_p5_mcheck_init(c);
  39. if (c->x86 == 6)
  40. intel_p6_mcheck_init(c);
  41. if (c->x86 == 15)
  42. intel_p4_mcheck_init(c);
  43. break;
  44. case X86_VENDOR_CENTAUR:
  45. if (c->x86 == 5)
  46. winchip_mcheck_init(c);
  47. break;
  48. default:
  49. break;
  50. }
  51. }
  52. static int __init mcheck_disable(char *str)
  53. {
  54. mce_disabled = 1;
  55. return 1;
  56. }
  57. static int __init mcheck_enable(char *str)
  58. {
  59. mce_disabled = -1;
  60. return 1;
  61. }
  62. __setup("nomce", mcheck_disable);
  63. __setup("mce", mcheck_enable);