Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _S390_BUG_H |
| 2 | #define _S390_BUG_H |
| 3 | |
| 4 | #include <linux/kernel.h> |
| 5 | |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 6 | #ifdef CONFIG_BUG |
Martin Schwidefsky | 4896cef | 2006-03-24 03:15:16 -0800 | [diff] [blame] | 7 | |
Heiko Carstens | f4a10b2 | 2006-07-12 16:39:42 +0200 | [diff] [blame] | 8 | static 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | #define BUG() do { \ |
Martin Schwidefsky | 4896cef | 2006-03-24 03:15:16 -0800 | [diff] [blame] | 18 | printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ |
Heiko Carstens | f4a10b2 | 2006-07-12 16:39:42 +0200 | [diff] [blame] | 19 | __do_illegal_op(); \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | } while (0) |
| 21 | |
| 22 | #define HAVE_ARCH_BUG |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 23 | #endif |
| 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #include <asm-generic/bug.h> |
| 26 | |
| 27 | #endif |