Commit | Line | Data |
---|---|---|
6d60cd53 GOC |
1 | #ifndef _ASM_X86_NMI_H_ |
2 | #define _ASM_X86_NMI_H_ | |
3 | ||
4 | #include <linux/pm.h> | |
5 | #include <asm/irq.h> | |
6 | #include <asm/io.h> | |
7 | ||
8 | #ifdef ARCH_HAS_NMI_WATCHDOG | |
9 | ||
10 | /** | |
11 | * do_nmi_callback | |
12 | * | |
13 | * Check to see if a callback exists and execute it. Return 1 | |
14 | * if the handler exists and was handled successfully. | |
15 | */ | |
16 | int do_nmi_callback(struct pt_regs *regs, int cpu); | |
17 | ||
6d60cd53 GOC |
18 | #ifdef CONFIG_X86_64 |
19 | extern void default_do_nmi(struct pt_regs *); | |
20 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); | |
50e440aa GOC |
21 | extern void nmi_watchdog_default(void); |
22 | #else | |
23 | #define nmi_watchdog_default() do {} while (0) | |
6d60cd53 GOC |
24 | #endif |
25 | ||
26 | extern int check_nmi_watchdog(void); | |
27 | extern int nmi_watchdog_enabled; | |
6d60cd53 GOC |
28 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
29 | extern int avail_to_resrv_perfctr_nmi(unsigned int); | |
30 | extern int reserve_perfctr_nmi(unsigned int); | |
31 | extern void release_perfctr_nmi(unsigned int); | |
32 | extern int reserve_evntsel_nmi(unsigned int); | |
33 | extern void release_evntsel_nmi(unsigned int); | |
6d60cd53 GOC |
34 | |
35 | extern void setup_apic_nmi_watchdog(void *); | |
36 | extern void stop_apic_nmi_watchdog(void *); | |
37 | extern void disable_timer_nmi_watchdog(void); | |
38 | extern void enable_timer_nmi_watchdog(void); | |
39 | extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason); | |
40 | ||
41 | extern atomic_t nmi_active; | |
42 | extern unsigned int nmi_watchdog; | |
43 | #define NMI_DISABLED -1 | |
44 | #define NMI_NONE 0 | |
45 | #define NMI_IO_APIC 1 | |
46 | #define NMI_LOCAL_APIC 2 | |
47 | #define NMI_INVALID 3 | |
48 | #define NMI_DEFAULT NMI_DISABLED | |
49 | ||
50 | struct ctl_table; | |
51 | struct file; | |
52 | extern int proc_nmi_enabled(struct ctl_table *, int , struct file *, | |
53 | void __user *, size_t *, loff_t *); | |
54 | extern int unknown_nmi_panic; | |
55 | ||
56 | void __trigger_all_cpu_backtrace(void); | |
57 | #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace() | |
58 | ||
148b5083 MR |
59 | static inline void localise_nmi_watchdog(void) |
60 | { | |
61 | if (nmi_watchdog == NMI_IO_APIC) | |
62 | nmi_watchdog = NMI_LOCAL_APIC; | |
63 | } | |
6d60cd53 GOC |
64 | #endif |
65 | ||
66 | void lapic_watchdog_stop(void); | |
67 | int lapic_watchdog_init(unsigned nmi_hz); | |
68 | int lapic_wd_event(unsigned nmi_hz); | |
69 | unsigned lapic_adjust_nmi_hz(unsigned hz); | |
70 | int lapic_watchdog_ok(void); | |
71 | void disable_lapic_nmi_watchdog(void); | |
72 | void enable_lapic_nmi_watchdog(void); | |
73 | void stop_nmi(void); | |
74 | void restart_nmi(void); | |
75 | ||
96a388de | 76 | #endif |