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> |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | struct pt_regs; |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 10 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | typedef int (*nmi_callback_t)(struct pt_regs * regs, int cpu); |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 12 | |
| 13 | /** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | * set_nmi_callback |
| 15 | * |
| 16 | * Set a handler for an NMI. Only one handler may be |
| 17 | * set. Return 1 if the NMI was handled. |
| 18 | */ |
| 19 | void set_nmi_callback(nmi_callback_t callback); |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 20 | |
| 21 | /** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | * unset_nmi_callback |
| 23 | * |
| 24 | * Remove the handler previously set. |
| 25 | */ |
| 26 | void unset_nmi_callback(void); |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 27 | |
Don Zickus | 828f0af | 2006-09-26 10:52:26 +0200 | [diff] [blame^] | 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); |
| 34 | |
Don Zickus | 3e4ff11 | 2006-06-26 13:57:01 +0200 | [diff] [blame] | 35 | extern void setup_apic_nmi_watchdog (void); |
| 36 | extern int reserve_lapic_nmi(void); |
| 37 | extern void release_lapic_nmi(void); |
| 38 | extern void disable_timer_nmi_watchdog(void); |
| 39 | extern void enable_timer_nmi_watchdog(void); |
| 40 | extern void nmi_watchdog_tick (struct pt_regs * regs); |
| 41 | |
| 42 | extern unsigned int nmi_watchdog; |
| 43 | #define NMI_DEFAULT -1 |
| 44 | #define NMI_NONE 0 |
| 45 | #define NMI_IO_APIC 1 |
| 46 | #define NMI_LOCAL_APIC 2 |
| 47 | #define NMI_INVALID 3 |
| 48 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | #endif /* ASM_NMI_H */ |