blob: 7eb63de808bc153cf3f14ed5b2f180365f0f168b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_BUG_H
2#define __ASM_BUG_H
3
Ralf Baechle63dc68a2006-10-16 01:38:50 +01004#include <asm/sgidefs.h>
Ralf Baechlefdb551a2005-05-19 12:08:04 +00005
6#ifdef CONFIG_BUG
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <asm/break.h>
9
10#define BUG() \
11do { \
12 __asm__ __volatile__("break %0" : : "i" (BRK_BUG)); \
13} while (0)
Ralf Baechle8592d4c2005-10-29 19:32:38 +010014
15#define HAVE_ARCH_BUG
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Ralf Baechle63dc68a2006-10-16 01:38:50 +010017#if (_MIPS_ISA > _MIPS_ISA_MIPS1)
18
19#define BUG_ON(condition) \
20do { \
Atsushi Nemotoba755f82007-04-12 20:02:54 +090021 __asm__ __volatile__("tne $0, %0, %1" \
22 : : "r" (condition), "i" (BRK_BUG)); \
Ralf Baechle63dc68a2006-10-16 01:38:50 +010023} while (0)
24
25#define HAVE_ARCH_BUG_ON
26
27#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
28
Linus Torvalds1da177e2005-04-16 15:20:36 -070029#endif
Ralf Baechlefdb551a2005-05-19 12:08:04 +000030
Ralf Baechleffd099b2005-05-19 17:05:09 +000031#include <asm-generic/bug.h>
32
Ralf Baechlefdb551a2005-05-19 12:08:04 +000033#endif /* __ASM_BUG_H */