machine_check.c 994 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version
  5. * 2 of the License, or (at your option) any later version.
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/printk.h>
  9. #include <linux/ptrace.h>
  10. #include <asm/reg.h>
  11. int machine_check_8xx(struct pt_regs *regs)
  12. {
  13. unsigned long reason = regs->msr;
  14. pr_err("Machine check in kernel mode.\n");
  15. pr_err("Caused by (from SRR1=%lx): ", reason);
  16. if (reason & 0x40000000)
  17. pr_err("Fetch error at address %lx\n", regs->nip);
  18. else
  19. pr_err("Data access error at address %lx\n", regs->dar);
  20. #ifdef CONFIG_PCI
  21. /* the qspan pci read routines can cause machine checks -- Cort
  22. *
  23. * yuck !!! that totally needs to go away ! There are better ways
  24. * to deal with that than having a wart in the mcheck handler.
  25. * -- BenH
  26. */
  27. bad_page_fault(regs, regs->dar, SIGBUS);
  28. return 1;
  29. #else
  30. return 0;
  31. #endif
  32. }