H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_NMI_H |
| 2 | #define _ASM_X86_NMI_H |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 3 | |
| 4 | #include <linux/pm.h> |
| 5 | #include <asm/irq.h> |
| 6 | #include <asm/io.h> |
| 7 | |
Don Zickus | 4a7863c | 2010-12-22 14:00:03 -0500 | [diff] [blame] | 8 | #ifdef CONFIG_X86_LOCAL_APIC |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 9 | |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 10 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 11 | extern int reserve_perfctr_nmi(unsigned int); |
| 12 | extern void release_perfctr_nmi(unsigned int); |
| 13 | extern int reserve_evntsel_nmi(unsigned int); |
| 14 | extern void release_evntsel_nmi(unsigned int); |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 15 | |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 16 | struct ctl_table; |
Alexey Dobriyan | 8d65af7 | 2009-09-23 15:57:19 -0700 | [diff] [blame] | 17 | extern int proc_nmi_enabled(struct ctl_table *, int , |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 18 | void __user *, size_t *, loff_t *); |
| 19 | extern int unknown_nmi_panic; |
| 20 | |
Ingo Molnar | 47cab6a | 2009-08-03 09:31:54 +0200 | [diff] [blame] | 21 | void arch_trigger_all_cpu_backtrace(void); |
| 22 | #define arch_trigger_all_cpu_backtrace arch_trigger_all_cpu_backtrace |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 23 | #endif |
| 24 | |
Don Zickus | c9126b2 | 2011-09-30 15:06:20 -0400 | [diff] [blame] | 25 | #define NMI_FLAG_FIRST 1 |
| 26 | |
| 27 | enum { |
| 28 | NMI_LOCAL=0, |
| 29 | NMI_UNKNOWN, |
| 30 | NMI_MAX |
| 31 | }; |
| 32 | |
| 33 | #define NMI_DONE 0 |
| 34 | #define NMI_HANDLED 1 |
| 35 | |
| 36 | typedef int (*nmi_handler_t)(unsigned int, struct pt_regs *); |
| 37 | |
| 38 | int register_nmi_handler(unsigned int, nmi_handler_t, unsigned long, |
| 39 | const char *); |
| 40 | |
| 41 | void unregister_nmi_handler(unsigned int, const char *); |
| 42 | |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 43 | void stop_nmi(void); |
| 44 | void restart_nmi(void); |
Don Zickus | b227e23 | 2011-09-30 15:06:22 -0400 | [diff] [blame] | 45 | void local_touch_nmi(void); |
Glauber de Oliveira Costa | 6d60cd5 | 2008-03-19 14:25:36 -0300 | [diff] [blame] | 46 | |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 47 | #endif /* _ASM_X86_NMI_H */ |