locking/refcounts: Include fewer headers in <linux/refcount.h>
[linux/fpc-iii.git] / arch / x86 / include / asm / nmi.h
blob75ded1d13d98d6cde6f01ab8602587145e010707
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_NMI_H
3 #define _ASM_X86_NMI_H
5 #include <linux/irq_work.h>
6 #include <linux/pm.h>
7 #include <asm/irq.h>
8 #include <asm/io.h>
10 #ifdef CONFIG_X86_LOCAL_APIC
12 extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
13 extern int reserve_perfctr_nmi(unsigned int);
14 extern void release_perfctr_nmi(unsigned int);
15 extern int reserve_evntsel_nmi(unsigned int);
16 extern void release_evntsel_nmi(unsigned int);
18 struct ctl_table;
19 extern int proc_nmi_enabled(struct ctl_table *, int ,
20 void __user *, size_t *, loff_t *);
21 extern int unknown_nmi_panic;
23 #endif /* CONFIG_X86_LOCAL_APIC */
25 #define NMI_FLAG_FIRST 1
27 enum {
28 NMI_LOCAL=0,
29 NMI_UNKNOWN,
30 NMI_SERR,
31 NMI_IO_CHECK,
32 NMI_MAX
35 #define NMI_DONE 0
36 #define NMI_HANDLED 1
38 typedef int (*nmi_handler_t)(unsigned int, struct pt_regs *);
40 struct nmiaction {
41 struct list_head list;
42 nmi_handler_t handler;
43 u64 max_duration;
44 struct irq_work irq_work;
45 unsigned long flags;
46 const char *name;
49 #define register_nmi_handler(t, fn, fg, n, init...) \
50 ({ \
51 static struct nmiaction init fn##_na = { \
52 .handler = (fn), \
53 .name = (n), \
54 .flags = (fg), \
55 }; \
56 __register_nmi_handler((t), &fn##_na); \
59 int __register_nmi_handler(unsigned int, struct nmiaction *);
61 void unregister_nmi_handler(unsigned int, const char *);
63 void stop_nmi(void);
64 void restart_nmi(void);
65 void local_touch_nmi(void);
67 #endif /* _ASM_X86_NMI_H */