blob: 695a5ee4b5d3da464ed25bab5668bcc861de1479 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ALPHA_BUG_H
2#define _ALPHA_BUG_H
3
Andrew Mortoned6b9b92008-04-28 02:13:48 -07004#include <linux/linkage.h>
5
Matt Mackallc8538a72005-05-01 08:59:01 -07006#ifdef CONFIG_BUG
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#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 Mortoned6b9b92008-04-28 02:13:48 -070011static 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 Torvalds1da177e2005-04-16 15:20:36 -070022
23#define HAVE_ARCH_BUG
Matt Mackallc8538a72005-05-01 08:59:01 -070024#endif
25
Linus Torvalds1da177e2005-04-16 15:20:36 -070026#include <asm-generic/bug.h>
27
28#endif