mach_traps.h 795 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * include/asm-i386/mach-default/mach_traps.h
  3. *
  4. * Machine specific NMI handling for generic.
  5. * Split out from traps.c by Osamu Tomita <tomita@cinet.co.jp>
  6. */
  7. #ifndef _MACH_TRAPS_H
  8. #define _MACH_TRAPS_H
  9. #include <asm/mc146818rtc.h>
  10. static inline void clear_mem_error(unsigned char reason)
  11. {
  12. reason = (reason & 0xf) | 4;
  13. outb(reason, 0x61);
  14. }
  15. static inline unsigned char get_nmi_reason(void)
  16. {
  17. return inb(0x61);
  18. }
  19. static inline void reassert_nmi(void)
  20. {
  21. int old_reg = -1;
  22. if (do_i_have_lock_cmos())
  23. old_reg = current_lock_cmos_reg();
  24. else
  25. lock_cmos(0); /* register doesn't matter here */
  26. outb(0x8f, 0x70);
  27. inb(0x71); /* dummy */
  28. outb(0x0f, 0x70);
  29. inb(0x71); /* dummy */
  30. if (old_reg >= 0)
  31. outb(old_reg, 0x70);
  32. else
  33. unlock_cmos();
  34. }
  35. #endif /* !_MACH_TRAPS_H */