blob: 87689836394442804ce094da6358dd898c272081 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _S390_BUG_H
2#define _S390_BUG_H
3
4#include <linux/kernel.h>
5
Matt Mackallc8538a72005-05-01 08:59:01 -07006#ifdef CONFIG_BUG
Martin Schwidefsky4896cef2006-03-24 03:15:16 -08007
Heiko Carstensf4a10b22006-07-12 16:39:42 +02008static inline __attribute__((noreturn)) void __do_illegal_op(void)
9{
10#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
11 __builtin_trap();
12#else
13 asm volatile(".long 0");
14#endif
15}
16
Linus Torvalds1da177e2005-04-16 15:20:36 -070017#define BUG() do { \
Martin Schwidefsky4896cef2006-03-24 03:15:16 -080018 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
Heiko Carstensf4a10b22006-07-12 16:39:42 +020019 __do_illegal_op(); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070020} while (0)
21
22#define HAVE_ARCH_BUG
Matt Mackallc8538a72005-05-01 08:59:01 -070023#endif
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#include <asm-generic/bug.h>
26
27#endif