Commit | Line | Data |
---|---|---|
1965aae3 PA |
1 | #ifndef _ASM_X86_NMI_H |
2 | #define _ASM_X86_NMI_H | |
6d60cd53 GOC |
3 | |
4 | #include <linux/pm.h> | |
5 | #include <asm/irq.h> | |
6 | #include <asm/io.h> | |
7 | ||
4a7863cc | 8 | #ifdef CONFIG_X86_LOCAL_APIC |
6d60cd53 | 9 | |
6d60cd53 | 10 | extern int avail_to_resrv_perfctr_nmi_bit(unsigned int); |
6d60cd53 GOC |
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); | |
6d60cd53 | 15 | |
6d60cd53 | 16 | struct ctl_table; |
8d65af78 | 17 | extern int proc_nmi_enabled(struct ctl_table *, int , |
6d60cd53 GOC |
18 | void __user *, size_t *, loff_t *); |
19 | extern int unknown_nmi_panic; | |
20 | ||
b52e0a7c | 21 | #endif /* CONFIG_X86_LOCAL_APIC */ |
6d60cd53 | 22 | |
c9126b2e DZ |
23 | #define NMI_FLAG_FIRST 1 |
24 | ||
25 | enum { | |
26 | NMI_LOCAL=0, | |
27 | NMI_UNKNOWN, | |
553222f3 DZ |
28 | NMI_SERR, |
29 | NMI_IO_CHECK, | |
c9126b2e DZ |
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 | ||
72b3fb24 LZ |
38 | struct nmiaction { |
39 | struct list_head list; | |
40 | nmi_handler_t handler; | |
6ff968cc | 41 | unsigned long flags; |
72b3fb24 LZ |
42 | const char *name; |
43 | }; | |
44 | ||
0718467c | 45 | #define register_nmi_handler(t, fn, fg, n, init...) \ |
72b3fb24 | 46 | ({ \ |
0718467c | 47 | static struct nmiaction init fn##_na = { \ |
72b3fb24 LZ |
48 | .handler = (fn), \ |
49 | .name = (n), \ | |
50 | .flags = (fg), \ | |
51 | }; \ | |
0718467c | 52 | __register_nmi_handler((t), &fn##_na); \ |
eeaaa96a DZ |
53 | }) |
54 | ||
72b3fb24 | 55 | int __register_nmi_handler(unsigned int, struct nmiaction *); |
c9126b2e DZ |
56 | |
57 | void unregister_nmi_handler(unsigned int, const char *); | |
58 | ||
6d60cd53 GOC |
59 | void stop_nmi(void); |
60 | void restart_nmi(void); | |
b227e233 | 61 | void local_touch_nmi(void); |
6d60cd53 | 62 | |
1965aae3 | 63 | #endif /* _ASM_X86_NMI_H */ |