blob: eaa8f8d38125ca976e4aa911ca050db10f4fba9f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _SPARC_BUG_H
2#define _SPARC_BUG_H
3
Matt Mackallc8538a72005-05-01 08:59:01 -07004#ifdef CONFIG_BUG
David S. Millere10195c2007-11-16 02:53:50 -08005#include <linux/compiler.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7#ifdef CONFIG_DEBUG_BUGVERBOSE
Sam Ravnborgf05a6862014-05-16 23:25:50 +02008void do_BUG(const char *file, int line);
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#define BUG() do { \
10 do_BUG(__FILE__, __LINE__); \
David S. Millere10195c2007-11-16 02:53:50 -080011 __builtin_trap(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070012} while (0)
13#else
David S. Millere10195c2007-11-16 02:53:50 -080014#define BUG() __builtin_trap()
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#endif
16
17#define HAVE_ARCH_BUG
Matt Mackallc8538a72005-05-01 08:59:01 -070018#endif
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <asm-generic/bug.h>
21
David Howellsd550bbd2012-03-28 18:30:03 +010022struct pt_regs;
Sam Ravnborgfcd01962014-04-21 21:39:21 +020023void __noreturn die_if_kernel(char *str, struct pt_regs *regs);
David Howellsd550bbd2012-03-28 18:30:03 +010024
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#endif