bug.h 720 Bytes
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
2
3
#ifndef __ASM_BUG_H
#define __ASM_BUG_H

4
#include <linux/compiler.h>
5
#include <asm/sgidefs.h>
6
7
8

#ifdef CONFIG_BUG

Linus Torvalds's avatar
Linus Torvalds committed
9
10
#include <asm/break.h>

David Daney's avatar
David Daney committed
11
12
13
static inline void __noreturn BUG(void)
{
	__asm__ __volatile__("break %0" : : "i" (BRK_BUG));
14
	unreachable();
David Daney's avatar
David Daney committed
15
}
Ralf Baechle's avatar
Ralf Baechle committed
16
17

#define HAVE_ARCH_BUG
Linus Torvalds's avatar
Linus Torvalds committed
18

19
20
#if (_MIPS_ISA > _MIPS_ISA_MIPS1)

David Daney's avatar
David Daney committed
21
22
23
24
25
26
27
28
29
30
31
32
33
static inline void  __BUG_ON(unsigned long condition)
{
	if (__builtin_constant_p(condition)) {
		if (condition)
			BUG();
		else
			return;
	}
	__asm__ __volatile__("tne $0, %0, %1"
			     : : "r" (condition), "i" (BRK_BUG));
}

#define BUG_ON(C) __BUG_ON((unsigned long)(C))
34
35
36
37
38

#define HAVE_ARCH_BUG_ON

#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */

Linus Torvalds's avatar
Linus Torvalds committed
39
#endif
40

41
42
#include <asm-generic/bug.h>

43
#endif /* __ASM_BUG_H */