Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Andrew Morton | bb81a09 | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 8 | #include <asm/irq.h> |
| 9 | |
| 10 | #ifdef ARCH_HAS_NMI_WATCHDOG |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 11 | |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 12 | /** |
Don Zickus | 2fbe7b2 | 2006-09-26 10:52:27 +0200 | [diff] [blame] | 13 | * do_nmi_callback |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | * |
Don Zickus | 2fbe7b2 | 2006-09-26 10:52:27 +0200 | [diff] [blame] | 15 | * Check to see if a callback exists and execute it. Return 1 |
| 16 | * if the handler exists and was handled successfully. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | */ |
Don Zickus | 2fbe7b2 | 2006-09-26 10:52:27 +0200 | [diff] [blame] | 18 | int do_nmi_callback(struct pt_regs *regs, int cpu); |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 19 | |
Don Zickus | 407984f | 2006-09-26 10:52:27 +0200 | [diff] [blame] | 20 | extern int nmi_watchdog_enabled; |
Don Zickus | 828f0af | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 21 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
| 22 | extern int avail_to_resrv_perfctr_nmi(unsigned int); |
| 23 | extern int reserve_perfctr_nmi(unsigned int); |
| 24 | extern void release_perfctr_nmi(unsigned int); |
| 25 | extern int reserve_evntsel_nmi(unsigned int); |
| 26 | extern void release_evntsel_nmi(unsigned int); |
| 27 | |
Don Zickus | b7471c6 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 28 | extern void setup_apic_nmi_watchdog (void *); |
Shaohua Li | 4038f90 | 2006-09-26 10:52:27 +0200 | [diff] [blame] | 29 | extern void stop_apic_nmi_watchdog (void *); |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 30 | extern void disable_timer_nmi_watchdog(void); |
| 31 | extern void enable_timer_nmi_watchdog(void); |
Don Zickus | 3adbbcc | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 32 | extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 33 | |
Don Zickus | b7471c6 | 2006-09-26 10:52:26 +0200 | [diff] [blame] | 34 | extern atomic_t nmi_active; |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 35 | extern unsigned int nmi_watchdog; |
Daniel Gollub | 0328ece | 2007-08-15 02:40:35 +0200 | [diff] [blame] | 36 | #define NMI_DISABLED -1 |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 37 | #define NMI_NONE 0 |
| 38 | #define NMI_IO_APIC 1 |
| 39 | #define NMI_LOCAL_APIC 2 |
| 40 | #define NMI_INVALID 3 |
Daniel Gollub | 0328ece | 2007-08-15 02:40:35 +0200 | [diff] [blame] | 41 | #define NMI_DEFAULT NMI_DISABLED |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 42 | |
Andi Kleen | 29cbc78 | 2006-09-30 01:47:55 +0200 | [diff] [blame] | 43 | struct ctl_table; |
| 44 | struct file; |
| 45 | extern int proc_nmi_enabled(struct ctl_table *, int , struct file *, |
| 46 | void __user *, size_t *, loff_t *); |
| 47 | extern int unknown_nmi_panic; |
| 48 | |
Andrew Morton | bb81a09 | 2006-12-07 02:14:01 +0100 | [diff] [blame] | 49 | void __trigger_all_cpu_backtrace(void); |
| 50 | #define trigger_all_cpu_backtrace() __trigger_all_cpu_backtrace() |
| 51 | |
| 52 | #endif |
| 53 | |
Andi Kleen | 09198e6 | 2007-05-02 19:27:20 +0200 | [diff] [blame] | 54 | void lapic_watchdog_stop(void); |
| 55 | int lapic_watchdog_init(unsigned nmi_hz); |
| 56 | int lapic_wd_event(unsigned nmi_hz); |
| 57 | unsigned lapic_adjust_nmi_hz(unsigned hz); |
| 58 | int lapic_watchdog_ok(void); |
| 59 | void disable_lapic_nmi_watchdog(void); |
| 60 | void enable_lapic_nmi_watchdog(void); |
Andi Kleen | 8f4e956 | 2007-07-22 11:12:32 +0200 | [diff] [blame] | 61 | void stop_nmi(void); |
| 62 | void restart_nmi(void); |
Andi Kleen | 09198e6 | 2007-05-02 19:27:20 +0200 | [diff] [blame] | 63 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | #endif /* ASM_NMI_H */ |