1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 21965aae3SH. Peter Anvin #ifndef _ASM_X86_KDEBUG_H 31965aae3SH. Peter Anvin #define _ASM_X86_KDEBUG_H 4bb898558SAl Viro 5bb898558SAl Viro #include <linux/notifier.h> 6bb898558SAl Viro 7bb898558SAl Viro struct pt_regs; 8bb898558SAl Viro 9bb898558SAl Viro /* Grossly misnamed. */ 10bb898558SAl Viro enum die_val { 11bb898558SAl Viro DIE_OOPS = 1, 12bb898558SAl Viro DIE_INT3, 13bb898558SAl Viro DIE_DEBUG, 14bb898558SAl Viro DIE_PANIC, 15bb898558SAl Viro DIE_NMI, 16bb898558SAl Viro DIE_DIE, 17bb898558SAl Viro DIE_KERNELDEBUG, 18bb898558SAl Viro DIE_TRAP, 19bb898558SAl Viro DIE_GPF, 20bb898558SAl Viro DIE_CALL, 21bb898558SAl Viro DIE_PAGE_FAULT, 22bb898558SAl Viro DIE_NMIUNKNOWN, 23bb898558SAl Viro }; 24bb898558SAl Viro 259fe6299dSJann Horn enum show_regs_mode { 269fe6299dSJann Horn SHOW_REGS_SHORT, 279fe6299dSJann Horn /* 289fe6299dSJann Horn * For when userspace crashed, but we don't think it's our fault, and 299fe6299dSJann Horn * therefore don't print kernel registers. 309fe6299dSJann Horn */ 319fe6299dSJann Horn SHOW_REGS_USER, 329fe6299dSJann Horn SHOW_REGS_ALL 339fe6299dSJann Horn }; 349fe6299dSJann Horn 35bb898558SAl Viro extern void die(const char *, struct pt_regs *,long); 36aa49f204SJann Horn void die_addr(const char *str, struct pt_regs *regs, long err, long gp_addr); 37bb898558SAl Viro extern int __must_check __die(const char *, struct pt_regs *, long); 3881c2949fSBorislav Petkov extern void show_stack_regs(struct pt_regs *regs); 39*44e21535SDmitry Safonov extern void __show_regs(struct pt_regs *regs, enum show_regs_mode, 40*44e21535SDmitry Safonov const char *log_lvl); 41fd07f802SDmitry Safonov extern void show_iret_regs(struct pt_regs *regs, const char *log_lvl); 42bb898558SAl Viro extern unsigned long oops_begin(void); 43bb898558SAl Viro extern void oops_end(unsigned long, struct pt_regs *, int signr); 44bb898558SAl Viro 451965aae3SH. Peter Anvin #endif /* _ASM_X86_KDEBUG_H */ 46