mach_traps.h 810 B

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