Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 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 | |
| 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 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 26 | #else |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 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 |
| 40 | extern void default_do_nmi(struct pt_regs *); |
| 41 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); |
| 42 | #endif |
| 43 | |
| 44 | extern int check_nmi_watchdog(void); |
| 45 | extern int nmi_watchdog_enabled; |
| 46 | extern int unknown_nmi_panic; |
| 47 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
| 48 | extern int avail_to_resrv_perfctr_nmi(unsigned int); |
| 49 | extern int reserve_perfctr_nmi(unsigned int); |
| 50 | extern void release_perfctr_nmi(unsigned int); |
| 51 | extern int reserve_evntsel_nmi(unsigned int); |
| 52 | extern void release_evntsel_nmi(unsigned int); |
| 53 | extern void nmi_watchdog_default(void); |
| 54 | |
| 55 | extern void setup_apic_nmi_watchdog(void *); |
| 56 | extern void stop_apic_nmi_watchdog(void *); |
| 57 | extern void disable_timer_nmi_watchdog(void); |
| 58 | extern void enable_timer_nmi_watchdog(void); |
| 59 | extern int nmi_watchdog_tick(struct pt_regs *regs, unsigned reason); |
| 60 | |
| 61 | extern atomic_t nmi_active; |
| 62 | extern unsigned int nmi_watchdog; |
| 63 | #define NMI_DISABLED -1 |
| 64 | #define NMI_NONE 0 |
| 65 | #define NMI_IO_APIC 1 |
| 66 | #define NMI_LOCAL_APIC 2 |
| 67 | #define NMI_INVALID 3 |
| 68 | #define NMI_DEFAULT NMI_DISABLED |
| 69 | |
| 70 | struct ctl_table; |
| 71 | struct file; |
| 72 | extern int proc_nmi_enabled(struct ctl_table *, int , struct file *, |
| 73 | void __user *, size_t *, loff_t *); |
| 74 | extern int unknown_nmi_panic; |
| 75 | |
| 76 | void __trigger_all_cpu_backtrace(void); |
| 77 | #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace() |
| 78 | |
| 79 | #endif |
| 80 | |
| 81 | void lapic_watchdog_stop(void); |
| 82 | int lapic_watchdog_init(unsigned nmi_hz); |
| 83 | int lapic_wd_event(unsigned nmi_hz); |
| 84 | unsigned lapic_adjust_nmi_hz(unsigned hz); |
| 85 | int lapic_watchdog_ok(void); |
| 86 | void disable_lapic_nmi_watchdog(void); |
| 87 | void enable_lapic_nmi_watchdog(void); |
| 88 | void stop_nmi(void); |
| 89 | void restart_nmi(void); |
| 90 | |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 91 | #endif |