2 * Machine specific NMI handling for generic.
3 * Split out from traps.c by Osamu Tomita <tomita@cinet.co.jp>
5 #ifndef _ASM_X86_MACH_DEFAULT_MACH_TRAPS_H
6 #define _ASM_X86_MACH_DEFAULT_MACH_TRAPS_H
10 #include <asm/mc146818rtc.h>
12 #define NMI_REASON_PORT 0x61
14 #define NMI_REASON_SERR 0x80
15 #define NMI_REASON_IOCHK 0x40
16 #define NMI_REASON_MASK (NMI_REASON_SERR | NMI_REASON_IOCHK)
18 #define NMI_REASON_CLEAR_SERR 0x04
19 #define NMI_REASON_CLEAR_IOCHK 0x08
20 #define NMI_REASON_CLEAR_MASK 0x0f
22 static inline unsigned char default_get_nmi_reason(void)
24 return inb(NMI_REASON_PORT);
27 static inline void clear_serr_error(unsigned char reason)
29 reason = (reason & NMI_REASON_CLEAR_MASK) | NMI_REASON_CLEAR_SERR;
30 outb(reason, NMI_REASON_PORT);
33 static inline void clear_io_check_error(unsigned char reason)
37 reason = (reason & NMI_REASON_CLEAR_MASK) | NMI_REASON_CLEAR_IOCHK;
38 outb(reason, NMI_REASON_PORT);
46 reason &= ~NMI_REASON_CLEAR_IOCHK;
47 outb(reason, NMI_REASON_PORT);
50 static inline void reassert_nmi(void)
54 if (do_i_have_lock_cmos())
55 old_reg = current_lock_cmos_reg();
57 lock_cmos(0); /* register doesn't matter here */
59 inb(0x71); /* dummy */
61 inb(0x71); /* dummy */
68 #endif /* _ASM_X86_MACH_DEFAULT_MACH_TRAPS_H */