xref: /openbmc/linux/arch/arc/include/asm/bug.h (revision 3be80aaef861a60b85a9323462ebb5f623774f7a)
1*3be80aaeSVineet Gupta /*
2*3be80aaeSVineet Gupta  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3*3be80aaeSVineet Gupta  *
4*3be80aaeSVineet Gupta  * This program is free software; you can redistribute it and/or modify
5*3be80aaeSVineet Gupta  * it under the terms of the GNU General Public License version 2 as
6*3be80aaeSVineet Gupta  * published by the Free Software Foundation.
7*3be80aaeSVineet Gupta  */
8*3be80aaeSVineet Gupta 
9*3be80aaeSVineet Gupta #ifndef _ASM_ARC_BUG_H
10*3be80aaeSVineet Gupta #define _ASM_ARC_BUG_H
11*3be80aaeSVineet Gupta 
12*3be80aaeSVineet Gupta #ifndef __ASSEMBLY__
13*3be80aaeSVineet Gupta 
14*3be80aaeSVineet Gupta #include <asm/ptrace.h>
15*3be80aaeSVineet Gupta 
16*3be80aaeSVineet Gupta struct task_struct;
17*3be80aaeSVineet Gupta 
18*3be80aaeSVineet Gupta void show_regs(struct pt_regs *regs);
19*3be80aaeSVineet Gupta void show_stacktrace(struct task_struct *tsk, struct pt_regs *regs);
20*3be80aaeSVineet Gupta void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
21*3be80aaeSVineet Gupta 			    unsigned long address, unsigned long cause_reg);
22*3be80aaeSVineet Gupta void die(const char *str, struct pt_regs *regs, unsigned long address,
23*3be80aaeSVineet Gupta 	 unsigned long cause_reg);
24*3be80aaeSVineet Gupta 
25*3be80aaeSVineet Gupta #define BUG()	do {				\
26*3be80aaeSVineet Gupta 	dump_stack();					\
27*3be80aaeSVineet Gupta 	pr_warn("Kernel BUG in %s: %s: %d!\n",	\
28*3be80aaeSVineet Gupta 		__FILE__, __func__,  __LINE__);	\
29*3be80aaeSVineet Gupta } while (0)
30*3be80aaeSVineet Gupta 
31*3be80aaeSVineet Gupta #define HAVE_ARCH_BUG
32*3be80aaeSVineet Gupta 
33*3be80aaeSVineet Gupta #include <asm-generic/bug.h>
34*3be80aaeSVineet Gupta 
35*3be80aaeSVineet Gupta #endif	/* !__ASSEMBLY__ */
36*3be80aaeSVineet Gupta 
37*3be80aaeSVineet Gupta #endif
38