]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/bug.h
Merge master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / bug.h
index d625ee55f9571e68503cbd43d01240de1875d22b..99817a802ca4e4d7c6a6784b3be2d39620018aa0 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _ASM_POWERPC_BUG_H
 #define _ASM_POWERPC_BUG_H
+#ifdef __KERNEL__
 
+#include <asm/asm-compat.h>
 /*
  * Define an illegal instr to trap on the bug.
  * We don't use 0 because that marks the end of a function
 
 #ifndef __ASSEMBLY__
 
-#ifdef __powerpc64__
-#define BUG_TABLE_ENTRY                ".llong"
-#define BUG_TRAP_OP            "tdnei"
-#else 
-#define BUG_TABLE_ENTRY                ".long"
-#define BUG_TRAP_OP            "twnei"
-#endif /* __powerpc64__ */
-
 struct bug_entry {
        unsigned long   bug_addr;
        long            line;
@@ -40,16 +34,16 @@ struct bug_entry *find_bug(unsigned long bugaddr);
        __asm__ __volatile__(                                            \
                "1:     twi 31,0,0\n"                                    \
                ".section __bug_table,\"a\"\n"                           \
-               "\t"BUG_TABLE_ENTRY"    1b,%0,%1,%2\n"                   \
+               "\t"PPC_LONG"   1b,%0,%1,%2\n"                   \
                ".previous"                                              \
                : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
 } while (0)
 
 #define BUG_ON(x) do {                                         \
        __asm__ __volatile__(                                   \
-               "1:     "BUG_TRAP_OP"   %0,0\n"                 \
+               "1:     "PPC_TLNEI"     %0,0\n"                 \
                ".section __bug_table,\"a\"\n"                  \
-               "\t"BUG_TABLE_ENTRY"    1b,%1,%2,%3\n"          \
+               "\t"PPC_LONG"   1b,%1,%2,%3\n"          \
                ".previous"                                     \
                : : "r" ((long)(x)), "i" (__LINE__),            \
                    "i" (__FILE__), "i" (__FUNCTION__));        \
@@ -57,9 +51,9 @@ struct bug_entry *find_bug(unsigned long bugaddr);
 
 #define WARN_ON(x) do {                                                \
        __asm__ __volatile__(                                   \
-               "1:     "BUG_TRAP_OP"   %0,0\n"                 \
+               "1:     "PPC_TLNEI"     %0,0\n"                 \
                ".section __bug_table,\"a\"\n"                  \
-               "\t"BUG_TABLE_ENTRY"    1b,%1,%2,%3\n"          \
+               "\t"PPC_LONG"   1b,%1,%2,%3\n"          \
                ".previous"                                     \
                : : "r" ((long)(x)),                            \
                    "i" (__LINE__ + BUG_WARNING_TRAP),          \
@@ -74,4 +68,5 @@ struct bug_entry *find_bug(unsigned long bugaddr);
 
 #include <asm-generic/bug.h>
 
+#endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_BUG_H */