- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / arch / x86 / include / mach-xen / asm / mach_traps.h
1 /*
2  *  include/asm-xen/asm-i386/mach-xen/mach_traps.h
3  *
4  *  Machine specific NMI handling for Xen
5  */
6 #ifndef _MACH_TRAPS_H
7 #define _MACH_TRAPS_H
8
9 #include <linux/bitops.h>
10 #include <xen/interface/nmi.h>
11
12 #define NMI_REASON_SERR         0x80
13 #define NMI_REASON_IOCHK        0x40
14 #define NMI_REASON_MASK         (NMI_REASON_SERR | NMI_REASON_IOCHK)
15
16 static inline void clear_serr_error(unsigned char reason) {}
17 static inline void clear_io_check_error(unsigned char reason) {}
18
19 static inline unsigned char xen_get_nmi_reason(void)
20 {
21         shared_info_t *s = HYPERVISOR_shared_info;
22         unsigned char reason = 0;
23
24         /* construct a value which looks like it came from
25          * port 0x61.
26          */
27         if (test_bit(_XEN_NMIREASON_io_error, &s->arch.nmi_reason))
28                 reason |= NMI_REASON_IOCHK;
29         if (test_bit(_XEN_NMIREASON_parity_error, &s->arch.nmi_reason))
30                 reason |= NMI_REASON_SERR;
31
32         return reason;
33 }
34
35 static inline void reassert_nmi(void) {}
36
37 #endif /* !_MACH_TRAPS_H */