blob: 6f17528356b2f71c8a71764a0ac2715a3398a33f [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _SPARC_BUG_H
3#define _SPARC_BUG_H
4
Matt Mackallc8538a72005-05-01 08:59:01 -07005#ifdef CONFIG_BUG
David S. Millere10195c2007-11-16 02:53:50 -08006#include <linux/compiler.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
8#ifdef CONFIG_DEBUG_BUGVERBOSE
Sam Ravnborgf05a6862014-05-16 23:25:50 +02009void do_BUG(const char *file, int line);
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#define BUG() do { \
11 do_BUG(__FILE__, __LINE__); \
David S. Millere10195c2007-11-16 02:53:50 -080012 __builtin_trap(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070013} while (0)
14#else
David S. Millere10195c2007-11-16 02:53:50 -080015#define BUG() __builtin_trap()
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#endif
17
18#define HAVE_ARCH_BUG
Matt Mackallc8538a72005-05-01 08:59:01 -070019#endif
20
Linus Torvalds1da177e2005-04-16 15:20:36 -070021#include <asm-generic/bug.h>
22
David Howellsd550bbd2012-03-28 18:30:03 +010023struct pt_regs;
Sam Ravnborgfcd01962014-04-21 21:39:21 +020024void __noreturn die_if_kernel(char *str, struct pt_regs *regs);
David Howellsd550bbd2012-03-28 18:30:03 +010025
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#endif