Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ALPHA_BUG_H |
| 2 | #define _ALPHA_BUG_H |
| 3 | |
Andrew Morton | ed6b9b9 | 2008-04-28 02:13:48 -0700 | [diff] [blame] | 4 | #include <linux/linkage.h> |
| 5 | |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 6 | #ifdef CONFIG_BUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #include <asm/pal.h> |
| 8 | |
| 9 | /* ??? Would be nice to use .gprel32 here, but we can't be sure that the |
| 10 | function loaded the GP, so this could fail in modules. */ |
Andrew Morton | ed6b9b9 | 2008-04-28 02:13:48 -0700 | [diff] [blame] | 11 | static inline void ATTRIB_NORET __BUG(const char *file, int line) |
| 12 | { |
| 13 | __asm__ __volatile__( |
| 14 | "call_pal %0 # bugchk\n\t" |
| 15 | ".long %1\n\t.8byte %2" |
| 16 | : : "i" (PAL_bugchk), "i"(line), "i"(file)); |
| 17 | for ( ; ; ) |
| 18 | ; |
| 19 | } |
| 20 | |
| 21 | #define BUG() __BUG(__FILE__, __LINE__) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
| 23 | #define HAVE_ARCH_BUG |
Matt Mackall | c8538a7 | 2005-05-01 08:59:01 -0700 | [diff] [blame] | 24 | #endif |
| 25 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | #include <asm-generic/bug.h> |
| 27 | |
| 28 | #endif |