]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/x86/include/asm/nmi.h
UBUNTU: Ubuntu-4.15.0-96.97
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / nmi.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1965aae3
PA
2#ifndef _ASM_X86_NMI_H
3#define _ASM_X86_NMI_H
6d60cd53 4
e90c7853 5#include <linux/irq_work.h>
6d60cd53
GOC
6#include <linux/pm.h>
7#include <asm/irq.h>
8#include <asm/io.h>
9
4a7863cc 10#ifdef CONFIG_X86_LOCAL_APIC
6d60cd53 11
6d60cd53 12extern int avail_to_resrv_perfctr_nmi_bit(unsigned int);
6d60cd53
GOC
13extern int reserve_perfctr_nmi(unsigned int);
14extern void release_perfctr_nmi(unsigned int);
15extern int reserve_evntsel_nmi(unsigned int);
16extern void release_evntsel_nmi(unsigned int);
6d60cd53 17
6d60cd53 18struct ctl_table;
8d65af78 19extern int proc_nmi_enabled(struct ctl_table *, int ,
6d60cd53
GOC
20 void __user *, size_t *, loff_t *);
21extern int unknown_nmi_panic;
22
b52e0a7c 23#endif /* CONFIG_X86_LOCAL_APIC */
6d60cd53 24
c9126b2e
DZ
25#define NMI_FLAG_FIRST 1
26
27enum {
28 NMI_LOCAL=0,
29 NMI_UNKNOWN,
553222f3
DZ
30 NMI_SERR,
31 NMI_IO_CHECK,
c9126b2e
DZ
32 NMI_MAX
33};
34
35#define NMI_DONE 0
36#define NMI_HANDLED 1
37
38typedef int (*nmi_handler_t)(unsigned int, struct pt_regs *);
39
72b3fb24
LZ
40struct nmiaction {
41 struct list_head list;
42 nmi_handler_t handler;
e90c7853
PZ
43 u64 max_duration;
44 struct irq_work irq_work;
6ff968cc 45 unsigned long flags;
72b3fb24
LZ
46 const char *name;
47};
48
0718467c 49#define register_nmi_handler(t, fn, fg, n, init...) \
72b3fb24 50({ \
0718467c 51 static struct nmiaction init fn##_na = { \
72b3fb24
LZ
52 .handler = (fn), \
53 .name = (n), \
54 .flags = (fg), \
55 }; \
0718467c 56 __register_nmi_handler((t), &fn##_na); \
eeaaa96a
DZ
57})
58
72b3fb24 59int __register_nmi_handler(unsigned int, struct nmiaction *);
c9126b2e
DZ
60
61void unregister_nmi_handler(unsigned int, const char *);
62
6d60cd53
GOC
63void stop_nmi(void);
64void restart_nmi(void);
b227e233 65void local_touch_nmi(void);
6d60cd53 66
1965aae3 67#endif /* _ASM_X86_NMI_H */