blob: f091682e3cc84b4a9bffccc136147870b42fa6e0 [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. */
Alexey Dobriyanfb9a6802009-02-04 15:12:21 -080011#define BUG() do { \
Ivan Kokshaysky945048c2009-01-29 14:25:20 -080012 __asm__ __volatile__( \
13 "call_pal %0 # bugchk\n\t" \
14 ".long %1\n\t.8byte %2" \
15 : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \
David Daneyacadbfb2009-12-10 18:07:24 -050016 unreachable(); \
17 } while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19#define HAVE_ARCH_BUG
Matt Mackallc8538a72005-05-01 08:59:01 -070020#endif
21
Linus Torvalds1da177e2005-04-16 15:20:36 -070022#include <asm-generic/bug.h>
23
24#endif