diff options
Diffstat (limited to 'include/asm-x86/nmi.h')
-rw-r--r-- | include/asm-x86/nmi.h | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h index 1e363021e72f..21f8d0202a82 100644 --- a/include/asm-x86/nmi.h +++ b/include/asm-x86/nmi.h | |||
@@ -15,38 +15,13 @@ | |||
15 | */ | 15 | */ |
16 | int do_nmi_callback(struct pt_regs *regs, int cpu); | 16 | int do_nmi_callback(struct pt_regs *regs, int cpu); |
17 | 17 | ||
18 | #ifdef CONFIG_PM | ||
19 | |||
20 | /** Replace the PM callback routine for NMI. */ | ||
21 | struct pm_dev *set_nmi_pm_callback(pm_callback callback); | ||
22 | |||
23 | /** Unset the PM callback routine back to the default. */ | ||
24 | void unset_nmi_pm_callback(struct pm_dev *dev); | ||
25 | |||
26 | #else | ||
27 | |||
28 | static inline struct pm_dev *set_nmi_pm_callback(pm_callback callback) | ||
29 | { | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static inline void unset_nmi_pm_callback(struct pm_dev *dev) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | #endif /* CONFIG_PM */ | ||
38 | |||
39 | #ifdef CONFIG_X86_64 | 18 | #ifdef CONFIG_X86_64 |
40 | extern void default_do_nmi(struct pt_regs *); | 19 | extern void default_do_nmi(struct pt_regs *); |
41 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); | ||
42 | extern void nmi_watchdog_default(void); | ||
43 | #else | ||
44 | #define nmi_watchdog_default() do {} while (0) | ||
45 | #endif | 20 | #endif |
46 | 21 | ||
22 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); | ||
47 | extern int check_nmi_watchdog(void); | 23 | extern int check_nmi_watchdog(void); |
48 | extern int nmi_watchdog_enabled; | 24 | extern int nmi_watchdog_enabled; |
49 | extern int unknown_nmi_panic; | ||
50 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); | 25 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
51 | extern int avail_to_resrv_perfctr_nmi(unsigned int); | 26 | extern int avail_to_resrv_perfctr_nmi(unsigned int); |
52 | extern int reserve_perfctr_nmi(unsigned int); | 27 | extern int reserve_perfctr_nmi(unsigned int); |
@@ -62,12 +37,10 @@ extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason); | |||
62 | 37 | ||
63 | extern atomic_t nmi_active; | 38 | extern atomic_t nmi_active; |
64 | extern unsigned int nmi_watchdog; | 39 | extern unsigned int nmi_watchdog; |
65 | #define NMI_DISABLED -1 | ||
66 | #define NMI_NONE 0 | 40 | #define NMI_NONE 0 |
67 | #define NMI_IO_APIC 1 | 41 | #define NMI_IO_APIC 1 |
68 | #define NMI_LOCAL_APIC 2 | 42 | #define NMI_LOCAL_APIC 2 |
69 | #define NMI_INVALID 3 | 43 | #define NMI_INVALID 3 |
70 | #define NMI_DEFAULT NMI_DISABLED | ||
71 | 44 | ||
72 | struct ctl_table; | 45 | struct ctl_table; |
73 | struct file; | 46 | struct file; |
@@ -78,6 +51,24 @@ extern int unknown_nmi_panic; | |||
78 | void __trigger_all_cpu_backtrace(void); | 51 | void __trigger_all_cpu_backtrace(void); |
79 | #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace() | 52 | #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace() |
80 | 53 | ||
54 | static inline void localise_nmi_watchdog(void) | ||
55 | { | ||
56 | if (nmi_watchdog == NMI_IO_APIC) | ||
57 | nmi_watchdog = NMI_LOCAL_APIC; | ||
58 | } | ||
59 | |||
60 | /* check if nmi_watchdog is active (ie was specified at boot) */ | ||
61 | static inline int nmi_watchdog_active(void) | ||
62 | { | ||
63 | /* | ||
64 | * actually it should be: | ||
65 | * return (nmi_watchdog == NMI_LOCAL_APIC || | ||
66 | * nmi_watchdog == NMI_IO_APIC) | ||
67 | * but since they are power of two we could use a | ||
68 | * cheaper way --cvg | ||
69 | */ | ||
70 | return nmi_watchdog & 0x3; | ||
71 | } | ||
81 | #endif | 72 | #endif |
82 | 73 | ||
83 | void lapic_watchdog_stop(void); | 74 | void lapic_watchdog_stop(void); |