This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-x86_64 / mach-xen / asm / nmi.h
1 /*
2  *  linux/include/asm-i386/nmi.h
3  */
4 #ifndef ASM_NMI_H
5 #define ASM_NMI_H
6
7 #include <linux/pm.h>
8
9 #include <xen/interface/nmi.h>
10
11 struct pt_regs;
12  
13 typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu);
14  
15 /** 
16  * set_nmi_callback
17  *
18  * Set a handler for an NMI. Only one handler may be
19  * set. Return 1 if the NMI was handled.
20  */
21 void set_nmi_callback(nmi_callback_t callback);
22  
23 /** 
24  * unset_nmi_callback
25  *
26  * Remove the handler previously set.
27  */
28 void unset_nmi_callback(void);
29  
30 #ifdef CONFIG_PM
31  
32 /** Replace the PM callback routine for NMI. */
33 struct pm_dev * set_nmi_pm_callback(pm_callback callback);
34
35 /** Unset the PM callback routine back to the default. */
36 void unset_nmi_pm_callback(struct pm_dev * dev);
37
38 #else
39
40 static inline struct pm_dev * set_nmi_pm_callback(pm_callback callback)
41 {
42         return 0;
43
44  
45 static inline void unset_nmi_pm_callback(struct pm_dev * dev)
46 {
47 }
48
49 #endif /* CONFIG_PM */
50  
51 extern void default_do_nmi(struct pt_regs *);
52 extern void die_nmi(char *str, struct pt_regs *regs);
53
54 static inline unsigned char get_nmi_reason(void)
55 {
56         shared_info_t *s = HYPERVISOR_shared_info;
57         unsigned char reason = 0;
58
59         /* construct a value which looks like it came from
60          * port 0x61.
61          */
62         if (test_bit(_XEN_NMIREASON_io_error, &s->arch.nmi_reason))
63                 reason |= 0x40;
64         if (test_bit(_XEN_NMIREASON_parity_error, &s->arch.nmi_reason))
65                 reason |= 0x80;
66
67         return reason;
68 }
69
70 extern int panic_on_timeout;
71 extern int unknown_nmi_panic;
72
73 extern int check_nmi_watchdog(void);
74  
75 #endif /* ASM_NMI_H */