1 #ifndef _ASM_POWERPC_BUG_H
2 #define _ASM_POWERPC_BUG_H
5 #include <asm/asm-compat.h>
7 * Define an illegal instr to trap on the bug.
8 * We don't use 0 because that marks the end of a function
9 * in the ELF ABI. That's "Boo Boo" in case you wonder...
11 #define BUG_OPCODE .long 0x00b00b00 /* For asm */
12 #define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */
17 unsigned long bug_addr;
23 struct bug_entry *find_bug(unsigned long bugaddr);
26 * If this bit is set in the line number it means that the trap
27 * is for WARN_ON rather than BUG or BUG_ON.
29 #define BUG_WARNING_TRAP 0x1000000
34 __asm__ __volatile__( \
36 ".section __bug_table,\"a\"\n" \
37 "\t"PPC_LONG" 1b,%0,%1,%2\n" \
39 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
42 #define BUG_ON(x) do { \
43 __asm__ __volatile__( \
44 "1: "PPC_TLNEI" %0,0\n" \
45 ".section __bug_table,\"a\"\n" \
46 "\t"PPC_LONG" 1b,%1,%2,%3\n" \
48 : : "r" ((long)(x)), "i" (__LINE__), \
49 "i" (__FILE__), "i" (__FUNCTION__)); \
52 #define WARN_ON(x) do { \
53 __asm__ __volatile__( \
54 "1: "PPC_TLNEI" %0,0\n" \
55 ".section __bug_table,\"a\"\n" \
56 "\t"PPC_LONG" 1b,%1,%2,%3\n" \
58 : : "r" ((long)(x)), \
59 "i" (__LINE__ + BUG_WARNING_TRAP), \
60 "i" (__FILE__), "i" (__FUNCTION__)); \
64 #define HAVE_ARCH_BUG_ON
65 #define HAVE_ARCH_WARN_ON
66 #endif /* CONFIG_BUG */
67 #endif /* __ASSEMBLY __ */
69 #include <asm-generic/bug.h>
71 #endif /* __KERNEL__ */
72 #endif /* _ASM_POWERPC_BUG_H */