Commit | Line | Data |
---|---|---|
1da177e4 LT |
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> | |
3e4ff115 | 8 | #include <asm/io.h> |
1da177e4 LT |
9 | |
10 | struct pt_regs; | |
3e4ff115 | 11 | |
1da177e4 | 12 | typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); |
3e4ff115 DZ |
13 | |
14 | /** | |
1da177e4 LT |
15 | * set_nmi_callback |
16 | * | |
17 | * Set a handler for an NMI. Only one handler may be | |
18 | * set. Return 1 if the NMI was handled. | |
19 | */ | |
20 | void set_nmi_callback(nmi_callback_t callback); | |
3e4ff115 DZ |
21 | |
22 | /** | |
1da177e4 LT |
23 | * unset_nmi_callback |
24 | * | |
25 | * Remove the handler previously set. | |
26 | */ | |
27 | void unset_nmi_callback(void); | |
3e4ff115 | 28 | |
1da177e4 LT |
29 | #ifdef CONFIG_PM |
30 | ||
31 | /** Replace the PM callback routine for NMI. */ | |
32 | struct pm_dev * set_nmi_pm_callback(pm_callback callback); | |
33 | ||
34 | /** Unset the PM callback routine back to the default. */ | |
35 | void unset_nmi_pm_callback(struct pm_dev * dev); | |
36 | ||
37 | #else | |
38 | ||
39 | static inline struct pm_dev * set_nmi_pm_callback(pm_callback callback) | |
40 | { | |
41 | return 0; | |
42 | } | |
43 | ||
44 | static inline void unset_nmi_pm_callback(struct pm_dev * dev) | |
45 | { | |
46 | } | |
47 | ||
48 | #endif /* CONFIG_PM */ | |
49 | ||
50 | extern void default_do_nmi(struct pt_regs *); | |
51 | extern void die_nmi(char *str, struct pt_regs *regs); | |
52 | ||
53 | #define get_nmi_reason() inb(0x61) | |
54 | ||
55 | extern int panic_on_timeout; | |
56 | extern int unknown_nmi_panic; | |
75152114 AK |
57 | |
58 | extern int check_nmi_watchdog(void); | |
1da177e4 | 59 | |
3e4ff115 DZ |
60 | extern void setup_apic_nmi_watchdog (void); |
61 | extern int reserve_lapic_nmi(void); | |
62 | extern void release_lapic_nmi(void); | |
63 | extern void disable_timer_nmi_watchdog(void); | |
64 | extern void enable_timer_nmi_watchdog(void); | |
65 | extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); | |
66 | ||
67 | extern void nmi_watchdog_default(void); | |
68 | extern int setup_nmi_watchdog(char *); | |
69 | ||
70 | extern unsigned int nmi_watchdog; | |
71 | #define NMI_DEFAULT -1 | |
72 | #define NMI_NONE 0 | |
73 | #define NMI_IO_APIC 1 | |
74 | #define NMI_LOCAL_APIC 2 | |
75 | #define NMI_INVALID 3 | |
76 | ||
1da177e4 | 77 | #endif /* ASM_NMI_H */ |