mach_traps.h 694 B

123456789101112131415161718192021222324252627282930313233
  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 unsigned char get_nmi_reason(void)
  9. {
  10. return inb(0x61);
  11. }
  12. static inline void reassert_nmi(void)
  13. {
  14. int old_reg = -1;
  15. if (do_i_have_lock_cmos())
  16. old_reg = current_lock_cmos_reg();
  17. else
  18. lock_cmos(0); /* register doesn't matter here */
  19. outb(0x8f, 0x70);
  20. inb(0x71); /* dummy */
  21. outb(0x0f, 0x70);
  22. inb(0x71); /* dummy */
  23. if (old_reg >= 0)
  24. outb(old_reg, 0x70);
  25. else
  26. unlock_cmos();
  27. }
  28. #endif /* _ASM_X86_MACH_DEFAULT_MACH_TRAPS_H */