• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/arch/mips/include/asm/
1#ifndef __ASM_BUG_H
2#define __ASM_BUG_H
3
4#include <linux/compiler.h>
5#include <asm/sgidefs.h>
6
7#ifdef CONFIG_BUG
8
9#include <asm/break.h>
10
11static inline void __noreturn BUG(void)
12{
13#ifdef CONFIG_CPU_MICROMIPS
14	__asm__ __volatile__("break %0" : : "i" (MM_BRK_BUG));
15#else
16	__asm__ __volatile__("break %0" : : "i" (BRK_BUG));
17#endif
18	unreachable();
19}
20
21#define HAVE_ARCH_BUG
22
23#if (_MIPS_ISA > _MIPS_ISA_MIPS1)
24
25static inline void  __BUG_ON(unsigned long condition)
26{
27	if (__builtin_constant_p(condition)) {
28		if (condition)
29			BUG();
30		else
31			return;
32	}
33	__asm__ __volatile__("tne $0, %0, %1"
34#ifdef CONFIG_CPU_MICROMIPS
35			     : : "r" (condition), "i" (MM_BRK_BUG));
36#else
37			     : : "r" (condition), "i" (BRK_BUG));
38#endif
39}
40
41#define BUG_ON(C) __BUG_ON((unsigned long)(C))
42
43#define HAVE_ARCH_BUG_ON
44
45#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
46
47#endif
48
49#include <asm-generic/bug.h>
50
51#endif /* __ASM_BUG_H */
52