blob: 75f1e35e7c1537d8323cf7ce17d05c95759c350b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_KDEBUG_H
3#define _ASM_X86_KDEBUG_H
Thomas Gleixner35cc4612007-10-15 23:28:20 +02004
5#include <linux/notifier.h>
6
7struct pt_regs;
8
9/* Grossly misnamed. */
10enum die_val {
11 DIE_OOPS = 1,
12 DIE_INT3,
13 DIE_DEBUG,
14 DIE_PANIC,
15 DIE_NMI,
16 DIE_DIE,
Thomas Gleixner35cc4612007-10-15 23:28:20 +020017 DIE_KERNELDEBUG,
18 DIE_TRAP,
19 DIE_GPF,
20 DIE_CALL,
Thomas Gleixner35cc4612007-10-15 23:28:20 +020021 DIE_PAGE_FAULT,
Jason Wesseld3597522008-02-15 14:55:53 -060022 DIE_NMIUNKNOWN,
Thomas Gleixner35cc4612007-10-15 23:28:20 +020023};
24
Jann Horn9fe62992018-08-31 21:41:51 +020025enum show_regs_mode {
26 SHOW_REGS_SHORT,
27 /*
28 * For when userspace crashed, but we don't think it's our fault, and
29 * therefore don't print kernel registers.
30 */
31 SHOW_REGS_USER,
32 SHOW_REGS_ALL
33};
34
Joe Perchesf461f132008-03-23 01:02:31 -070035extern void die(const char *, struct pt_regs *,long);
Jan Beulich22f59912008-01-30 13:31:23 +010036extern int __must_check __die(const char *, struct pt_regs *, long);
Borislav Petkov81c29492016-07-05 00:31:27 +020037extern void show_stack_regs(struct pt_regs *regs);
Jann Horn9fe62992018-08-31 21:41:51 +020038extern void __show_regs(struct pt_regs *regs, enum show_regs_mode);
Josh Poimboeufb02fcf92017-12-04 15:07:09 +010039extern void show_iret_regs(struct pt_regs *regs);
Thomas Gleixner35cc4612007-10-15 23:28:20 +020040extern unsigned long oops_begin(void);
Jan Beulich22f59912008-01-30 13:31:23 +010041extern void oops_end(unsigned long, struct pt_regs *, int signr);
Thomas Gleixner35cc4612007-10-15 23:28:20 +020042
H. Peter Anvin1965aae2008-10-22 22:26:29 -070043#endif /* _ASM_X86_KDEBUG_H */