RT-AC56 3.0.0.4.374.37 core
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / cris / include / arch-v10 / arch / bug.h
blob9c767f9eb918c0d5ac791556d65aaba59be1a970
1 #ifndef __ASM_CRISv10_ARCH_BUG_H
2 #define __ASM_CRISv10_ARCH_BUG_H
4 #include <linux/stringify.h>
6 #ifdef CONFIG_BUG
7 #ifdef CONFIG_DEBUG_BUGVERBOSE
8 /* The BUG() macro is used for marking obviously incorrect code paths.
9 * It will cause a message with the file name and line number to be printed,
10 * and then cause an oops. The message is actually printed by handle_BUG()
11 * in arch/cris/kernel/traps.c, and the reason we use this method of storing
12 * the file name and line number is that we do not want to affect the registers
13 * by calling printk() before causing the oops.
16 #define BUG_PREFIX 0x0D7F
17 #define BUG_MAGIC 0x00001234
19 struct bug_frame {
20 unsigned short prefix;
21 unsigned int magic;
22 unsigned short clear;
23 unsigned short movu;
24 unsigned short line;
25 unsigned short jump;
26 unsigned char *filename;
29 /* This version will have to do for now, until the compiler is fixed.
30 * The drawbacks of this version are that the file name will appear multiple
31 * times in the .rodata section, and that __LINE__ and __FILE__ can probably
32 * not be used like this with newer versions of gcc.
34 #define BUG() \
35 __asm__ __volatile__ ("clear.d [" __stringify(BUG_MAGIC) "]\n\t"\
36 "movu.w " __stringify(__LINE__) ",$r0\n\t"\
37 "jump 0f\n\t" \
38 ".section .rodata\n" \
39 "0:\t.string \"" __FILE__ "\"\n\t" \
40 ".previous")
42 #else
44 /* This just causes an oops. */
45 #define BUG() (*(int *)0 = 0)
47 #endif
49 #define HAVE_ARCH_BUG
50 #endif
52 #include <asm-generic/bug.h>
54 #endif