]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] use <asm/bug.h> for BUG() defines
authorRussell King <rmk@arm.linux.org.uk>
Mon, 13 Jan 2003 07:24:04 +0000 (23:24 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 13 Jan 2003 07:24:04 +0000 (23:24 -0800)
This patch moves BUG() and PAGE_BUG() from asm/page.h into asm/bug.h.

We also fix up linux/dcache.h, which included asm/page.h for the sole
purpose of getting the BUG() definition.

Since linux/kernel.h and linux/smp.h make use of BUG(), asm/bug.h is
included there as well.

In addition, linux/jbd.h did not contain a clear path with which to
obtain the archtecture BUG() definition, but did contain its own
definition.

35 files changed:
include/asm-alpha/bug.h [new file with mode: 0644]
include/asm-alpha/page.h
include/asm-arm/bug.h [new file with mode: 0644]
include/asm-arm/page.h
include/asm-cris/bug.h [new file with mode: 0644]
include/asm-cris/page.h
include/asm-i386/bug.h [new file with mode: 0644]
include/asm-i386/page.h
include/asm-ia64/bug.h [new file with mode: 0644]
include/asm-ia64/page.h
include/asm-m68k/bug.h [new file with mode: 0644]
include/asm-m68k/page.h
include/asm-mips/bug.h [new file with mode: 0644]
include/asm-mips/page.h
include/asm-mips64/bug.h [new file with mode: 0644]
include/asm-mips64/page.h
include/asm-parisc/bug.h [new file with mode: 0644]
include/asm-parisc/page.h
include/asm-ppc/bug.h [new file with mode: 0644]
include/asm-ppc/page.h
include/asm-ppc/processor.h
include/asm-s390/bug.h [new file with mode: 0644]
include/asm-s390/page.h
include/asm-s390x/bug.h [new file with mode: 0644]
include/asm-s390x/page.h
include/asm-sh/bug.h [new file with mode: 0644]
include/asm-sh/page.h
include/asm-sparc/bug.h [new file with mode: 0644]
include/asm-sparc/page.h
include/asm-sparc64/bug.h [new file with mode: 0644]
include/asm-sparc64/page.h
include/linux/dcache.h
include/linux/jbd.h
include/linux/kernel.h
include/linux/smp.h

diff --git a/include/asm-alpha/bug.h b/include/asm-alpha/bug.h
new file mode 100644 (file)
index 0000000..0ff718c
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _ALPHA_BUG_H
+#define _ALPHA_BUG_H
+
+#include <asm/pal.h>
+
+/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
+   function loaded the GP, so this could fail in modules.  */
+#define BUG() \
+  __asm__ __volatile__("call_pal %0  # bugchk\n\t"".long %1\n\t.8byte %2" \
+                      : : "i" (PAL_bugchk), "i"(__LINE__), "i"(__FILE__))
+
+#define PAGE_BUG(page) BUG()
+
+#endif
index 43e414a33d952446250798d83832acb2eff0d011..2602b3685fe5732f9744ae538c0f83f01b861c56 100644 (file)
@@ -59,14 +59,6 @@ typedef unsigned long pgprot_t;
 
 #endif /* STRICT_MM_TYPECHECKS */
 
-/* ??? Would be nice to use .gprel32 here, but we can't be sure that the
-   function loaded the GP, so this could fail in modules.  */
-#define BUG() \
-  __asm__ __volatile__("call_pal %0  # bugchk\n\t"".long %1\n\t.8byte %2" \
-                      : : "i" (PAL_bugchk), "i"(__LINE__), "i"(__FILE__))
-
-#define PAGE_BUG(page) BUG()
-
 /* Pure 2^n version of get_order */
 extern __inline__ int get_order(unsigned long size)
 {
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
new file mode 100644 (file)
index 0000000..c9b6e7f
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _ASMARM_BUG_H
+#define _ASMARM_BUG_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+extern volatile void __bug(const char *file, int line, void *data);
+
+/* give file/line information */
+#define BUG()          __bug(__FILE__, __LINE__, NULL)
+#define PAGE_BUG(page) __bug(__FILE__, __LINE__, page)
+
+#else
+
+/* these just cause an oops */
+#define BUG()          (*(int *)0 = 0)
+#define PAGE_BUG(page) (*(int *)0 = 0)
+
+#endif
+
index 0b1a26ed991d564abdd82e94fa0edb149f808426..ca379e1f9184b515576fd47665f3d445cc8d7afb 100644 (file)
@@ -160,21 +160,6 @@ typedef unsigned long pgprot_t;
 #ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_DEBUG_BUGVERBOSE
-extern void __bug(const char *file, int line, void *data);
-
-/* give file/line information */
-#define BUG()          __bug(__FILE__, __LINE__, NULL)
-#define PAGE_BUG(page) __bug(__FILE__, __LINE__, page)
-
-#else
-
-/* these just cause an oops */
-#define BUG()          (*(int *)0 = 0)
-#define PAGE_BUG(page) (*(int *)0 = 0)
-
-#endif
-
 /* Pure 2^n version of get_order */
 static inline int get_order(unsigned long size)
 {
diff --git a/include/asm-cris/bug.h b/include/asm-cris/bug.h
new file mode 100644 (file)
index 0000000..64e1d8b
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _CRIS_BUG_H
+#define _CRIS_BUG_H
+
+#define BUG() do { \
+  printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+} while (0)
+
+#define PAGE_BUG(page) do { \
+         BUG(); \
+} while (0)
+
+#endif
index 01166c2bfd7cdabcba08f120cd46f2fea33ebce4..47c83465c2affc4aa0c578b18ebeef49d8c77aad 100644 (file)
@@ -70,18 +70,6 @@ typedef unsigned long pgprot_t;
 #define PAGE_OFFSET            KSEG_C   /* kseg_c is mapped to physical ram */
 #endif
 
-#ifndef __ASSEMBLY__
-
-#define BUG() do { \
-  printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-} while (0)
-
-#define PAGE_BUG(page) do { \
-         BUG(); \
-} while (0)
-
-#endif /* __ASSEMBLY__ */
-
 /* macros to convert between really physical and virtual addresses
  * by stripping a selected bit, we can convert between KSEG_x and 0x40000000 where
  * the DRAM really resides
diff --git a/include/asm-i386/bug.h b/include/asm-i386/bug.h
new file mode 100644 (file)
index 0000000..7a30b49
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _I386_BUG_H
+#define _I386_BUG_H
+
+#include <linux/config.h>
+
+/*
+ * Tell the user there is some problem. Beep too, so we can
+ * see^H^H^Hhear bugs in early bootup as well!
+ * The offending file and line are encoded after the "officially
+ * undefined" opcode for parsing in the trap handler.
+ */
+
+#if 1  /* Set to zero for a slightly smaller kernel */
+#define BUG()                          \
+ __asm__ __volatile__( "ud2\n"         \
+                       "\t.word %c0\n" \
+                       "\t.long %c1\n" \
+                        : : "i" (__LINE__), "i" (__FILE__))
+#else
+#define BUG() __asm__ __volatile__("ud2\n")
+#endif
+
+#define PAGE_BUG(page) do { \
+       BUG(); \
+} while (0)
+
+#endif
index 3c73ce930a0af196ba7c4be5980450d0371eb2d4..ebc1bf892bd325d852f9802db5378f0b7f432e7f 100644 (file)
@@ -99,27 +99,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 
 #ifndef __ASSEMBLY__
 
-/*
- * Tell the user there is some problem. Beep too, so we can
- * see^H^H^Hhear bugs in early bootup as well!
- * The offending file and line are encoded after the "officially
- * undefined" opcode for parsing in the trap handler.
- */
-
-#if 1  /* Set to zero for a slightly smaller kernel */
-#define BUG()                          \
- __asm__ __volatile__( "ud2\n"         \
-                       "\t.word %c0\n" \
-                       "\t.long %c1\n" \
-                        : : "i" (__LINE__), "i" (__FILE__))
-#else
-#define BUG() __asm__ __volatile__("ud2\n")
-#endif
-
-#define PAGE_BUG(page) do { \
-       BUG(); \
-} while (0)
-
 /* Pure 2^n version of get_order */
 static __inline__ int get_order(unsigned long size)
 {
diff --git a/include/asm-ia64/bug.h b/include/asm-ia64/bug.h
new file mode 100644 (file)
index 0000000..085cdb7
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _ASM_IA64_BUG_H
+#define _ASM_IA64_BUG_H
+
+#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define ia64_abort()  __builtin_trap()
+#else
+# define ia64_abort()  (*(volatile int *) 0 = 0)
+#endif
+#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
+#define PAGE_BUG(page) do { BUG(); } while (0)
+
+#endif
index 4f956057d17fa60d93ced7759db07dc46e0a79cd..2c78c70ee4775d669fdd5a0b3662462ae9cb863c 100644 (file)
@@ -125,14 +125,6 @@ typedef union ia64_va {
 # define HUGETLB_PAGE_ORDER    (HPAGE_SHIFT - PAGE_SHIFT)
 #endif
 
-#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-# define ia64_abort()  __builtin_trap()
-#else
-# define ia64_abort()  (*(volatile int *) 0 = 0)
-#endif
-#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); ia64_abort(); } while (0)
-#define PAGE_BUG(page) do { BUG(); } while (0)
-
 static __inline__ int
 get_order (unsigned long size)
 {
diff --git a/include/asm-m68k/bug.h b/include/asm-m68k/bug.h
new file mode 100644 (file)
index 0000000..92c5cc5
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _M68K_BUG_H
+#define _M68K_BUG_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+#ifndef CONFIG_SUN3
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       asm volatile("illegal"); \
+} while (0)
+#else
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       panic("BUG!"); \
+} while (0)
+#endif
+#else
+#define BUG() do { \
+       asm volatile("illegal"); \
+} while (0)
+#endif
+
+#define PAGE_BUG(page) do { \
+       BUG(); \
+} while (0)
+
+#endif
index 7ca3578dfa8f2238b180329b9036317abb369c0b..6c09c4f01e07457c589ccefa2fcfe406f3320a02 100644 (file)
@@ -178,28 +178,6 @@ static inline void *__va(unsigned long x)
 #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
 #define pfn_valid(pfn)         virt_addr_valid(pfn_to_virt(pfn))
 
-#ifdef CONFIG_DEBUG_BUGVERBOSE
-#ifndef CONFIG_SUN3
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       asm volatile("illegal"); \
-} while (0)
-#else
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       panic("BUG!"); \
-} while (0)
-#endif
-#else
-#define BUG() do { \
-       asm volatile("illegal"); \
-} while (0)
-#endif
-
-#define PAGE_BUG(page) do { \
-       BUG(); \
-} while (0)
-
 #endif /* __ASSEMBLY__ */
 
 #define VM_DATA_DEFAULT_FLAGS  (VM_READ | VM_WRITE | VM_EXEC | \
diff --git a/include/asm-mips/bug.h b/include/asm-mips/bug.h
new file mode 100644 (file)
index 0000000..a66c6f9
--- /dev/null
@@ -0,0 +1,8 @@
+/* $Id$ */
+#ifndef __ASM_BUG_H
+#define __ASM_BUG_H
+
+#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
+#define PAGE_BUG(page) do {  BUG(); } while (0)
+
+#endif
index d3fb0a1e2fde29a1bb36075d08e80d2e6722aabc..5cd2c52cb14fe91ff1aa183b62025ab61297cf3e 100644 (file)
@@ -20,9 +20,6 @@
 
 #ifndef _LANGUAGE_ASSEMBLY
 
-#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
-#define PAGE_BUG(page) do {  BUG(); } while (0)
-
 extern void (*_clear_page)(void * page);
 extern void (*_copy_page)(void * to, void * from);
 
diff --git a/include/asm-mips64/bug.h b/include/asm-mips64/bug.h
new file mode 100644 (file)
index 0000000..3bf0774
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _ASM_BUG_H
+#define _ASM_BUG_H
+
+#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
+#define PAGE_BUG(page) do {  BUG(); } while (0)
+
+#endif
index 9046c3474d4307c5a503cf0963352781e98edbf3..872855cea66ba250a6d8ed42b7df8d583a364402 100644 (file)
@@ -20,9 +20,6 @@
 
 #ifndef _LANGUAGE_ASSEMBLY
 
-#define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
-#define PAGE_BUG(page) do {  BUG(); } while (0)
-
 extern void (*_clear_page)(void * page);
 extern void (*_copy_page)(void * to, void * from);
 
diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h
new file mode 100644 (file)
index 0000000..d810287
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _PARISC_BUG_H
+#define _PARISC_BUG_H
+
+/*
+ * Tell the user there is some problem. Beep too, so we can
+ * see^H^H^Hhear bugs in early bootup as well!
+ *
+ * We don't beep yet.  prumpf
+ */
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+} while (0)
+
+#define PAGE_BUG(page) do { \
+       BUG(); \
+} while (0)
+
+#endif
index f754c241f7dd1c1673271dfe1c9a48abc9fc0636..b5db7b3da58405e36d8c815f7c25464bba6d13c2 100644 (file)
@@ -86,20 +86,6 @@ extern int npmem_ranges;
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)       (((addr)+PAGE_SIZE-1)&PAGE_MASK)
 
-/*
- * Tell the user there is some problem. Beep too, so we can
- * see^H^H^Hhear bugs in early bootup as well!
- *
- * We don't beep yet.  prumpf
- */
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-} while (0)
-
-#define PAGE_BUG(page) do { \
-       BUG(); \
-} while (0)
-
 
 #define LINUX_GATEWAY_SPACE     0
 #define __PAGE_OFFSET           (0x10000000)
diff --git a/include/asm-ppc/bug.h b/include/asm-ppc/bug.h
new file mode 100644 (file)
index 0000000..848c69a
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _PPC_BUG_H
+#define _PPC_BUG_H
+
+#include <linux/config.h>
+#include <asm/system.h> /* for xmon definition */
+
+#ifdef CONFIG_XMON
+extern void xmon(struct pt_regs *);
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       xmon(0); \
+} while (0)
+#else
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       __asm__ __volatile__(".long 0x0"); \
+} while (0)
+#endif
+#define PAGE_BUG(page) do { BUG(); } while (0)
+
+#endif
index e0429c2b5bc77458954329c5bdbe1197a7ddd14c..ff0f8f9acf62fda3af64c585d5bae6a898df95e1 100644 (file)
@@ -14,9 +14,6 @@
 #define KERNELBASE     PAGE_OFFSET
 
 #ifndef __ASSEMBLY__
-#include <asm/processor.h>     /* for BUG definition */
-
-#define PAGE_BUG(page) do { BUG(); } while (0)
 
 #define STRICT_MM_TYPECHECKS
 
index 6c71939531956a9bbc118fd5ea5532ddf78958e4..b958da9e3c13f786d1e4c87864e3376e84079a1b 100644 (file)
@@ -718,19 +718,6 @@ extern inline void prefetchw(const void *x)
 
 #define spin_lock_prefetch(x)  prefetchw(x)
 
-#ifdef CONFIG_XMON
-extern void xmon(struct pt_regs *);
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       xmon(0); \
-} while (0)
-#else
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       __asm__ __volatile__(".long 0x0"); \
-} while (0)
-#endif
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_PPC_PROCESSOR_H */
diff --git a/include/asm-s390/bug.h b/include/asm-s390/bug.h
new file mode 100644 (file)
index 0000000..38f2940
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _S390_BUG_H
+#define _S390_BUG_H
+
+#define BUG() do { \
+        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+        __asm__ __volatile__(".long 0"); \
+} while (0)                                       
+
+#define PAGE_BUG(page) do { \
+        BUG(); \
+} while (0)                      
+
+#endif
index 273b1a528af1eb3e50f444d385bf07cc1bbc4028..75ce536327d92ee7b23a111d25493460d233fcdb 100644 (file)
@@ -62,15 +62,6 @@ static inline void copy_page(void *to, void *from)
 #define clear_user_page(page, vaddr, pg)       clear_page(page)
 #define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
 
-#define BUG() do { \
-        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-        __asm__ __volatile__(".long 0"); \
-} while (0)                                       
-
-#define PAGE_BUG(page) do { \
-        BUG(); \
-} while (0)                      
-
 /* Pure 2^n version of get_order */
 extern __inline__ int get_order(unsigned long size)
 {
diff --git a/include/asm-s390x/bug.h b/include/asm-s390x/bug.h
new file mode 100644 (file)
index 0000000..38f2940
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _S390_BUG_H
+#define _S390_BUG_H
+
+#define BUG() do { \
+        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+        __asm__ __volatile__(".long 0"); \
+} while (0)                                       
+
+#define PAGE_BUG(page) do { \
+        BUG(); \
+} while (0)                      
+
+#endif
index ddbed4167af47baa8eb828ffcca88e9e1e03746f..e075af90adb2254fe89477c68f89718e3cd9ea2a 100644 (file)
@@ -60,15 +60,6 @@ static inline void copy_page(void *to, void *from)
 #define clear_user_page(page, vaddr, pg)    clear_page(page)
 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
 
-#define BUG() do { \
-        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-        __asm__ __volatile__(".long 0"); \
-} while (0)                                       
-
-#define PAGE_BUG(page) do { \
-        BUG(); \
-} while (0)                      
-
 /* Pure 2^n version of get_order */
 extern __inline__ int get_order(unsigned long size)
 {
diff --git a/include/asm-sh/bug.h b/include/asm-sh/bug.h
new file mode 100644 (file)
index 0000000..a8624ef
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __ASM_SH_BUG_H
+#define __ASM_SH_BUG_H
+
+/*
+ * Tell the user there is some problem.
+ */
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
+       asm volatile("nop"); \
+} while (0)
+
+#define PAGE_BUG(page) do { \
+       BUG(); \
+} while (0)
+
+#endif
index b124b63e23cea5949c7d01030baa713f9f81cc37..742f66dac325750f8095976d45f35326c393907c 100644 (file)
@@ -90,18 +90,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
 
 #ifndef __ASSEMBLY__
 
-/*
- * Tell the user there is some problem.
- */
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       asm volatile("nop"); \
-} while (0)
-
-#define PAGE_BUG(page) do { \
-       BUG(); \
-} while (0)
-
 /* Pure 2^n version of get_order */
 static __inline__ int get_order(unsigned long size)
 {
diff --git a/include/asm-sparc/bug.h b/include/asm-sparc/bug.h
new file mode 100644 (file)
index 0000000..2100cc5
--- /dev/null
@@ -0,0 +1,25 @@
+/* $Id$ */
+#ifndef _SPARC_BUG_H
+#define _SPARC_BUG_H
+
+/*
+ * XXX I am hitting compiler bugs with __builtin_trap. This has
+ * hit me before and rusty was blaming his netfilter bugs on
+ * this so lets disable it. - Anton
+ */
+#if 0
+/* We need the mb()'s so we don't trigger a compiler bug - Anton */
+#define BUG() do { \
+       mb(); \
+       __builtin_trap(); \
+       mb(); \
+} while(0)
+#else
+#define BUG() do { \
+       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; \
+} while (0)
+#endif
+
+#define PAGE_BUG(page) BUG()
+
+#endif
index 7e521e0c31f4a286c97e16c39eb649b3f79cddde..253f216f1e1e74d7d397fd5828c55b394cddc24b 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-/*
- * XXX I am hitting compiler bugs with __builtin_trap. This has
- * hit me before and rusty was blaming his netfilter bugs on
- * this so lets disable it. - Anton
- */
-#if 0
-/* We need the mb()'s so we don't trigger a compiler bug - Anton */
-#define BUG() do { \
-       mb(); \
-       __builtin_trap(); \
-       mb(); \
-} while(0)
-#else
-#define BUG() do { \
-       printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; \
-} while (0)
-#endif
-
-#define PAGE_BUG(page) BUG()
-
 #define clear_page(page)        memset((void *)(page), 0, PAGE_SIZE)
 #define copy_page(to,from)     memcpy((void *)(to), (void *)(from), PAGE_SIZE)
 #define clear_user_page(addr, vaddr, page)     clear_page(addr)
diff --git a/include/asm-sparc64/bug.h b/include/asm-sparc64/bug.h
new file mode 100644 (file)
index 0000000..7acd49b
--- /dev/null
@@ -0,0 +1,17 @@
+/* $Id$ */
+
+#ifndef _SPARC64_BUG_H
+#define _SPARC64_BUG_H
+
+#ifdef CONFIG_DEBUG_BUGVERBOSE
+extern void do_BUG(const char *file, int line);
+#define BUG() do {                                     \
+       do_BUG(__FILE__, __LINE__);                     \
+       __builtin_trap();                               \
+} while (0)
+#else
+#define BUG()          __builtin_trap()
+#endif
+
+
+#endif
index 208650062ebf902792e9b72853aff88acdae69dd..2fc25cfb7be89ce983e526e330c92d91a580a2e6 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_DEBUG_BUGVERBOSE
-extern void do_BUG(const char *file, int line);
-#define BUG() do {                                     \
-       do_BUG(__FILE__, __LINE__);                     \
-       __builtin_trap();                               \
-} while (0)
-#else
-#define BUG()          __builtin_trap()
-#endif
-
-#define PAGE_BUG(page) BUG()
-
 /* Sparc64 is slow at multiplication, we prefer to use some extra space. */
 #define WANT_PAGE_VIRTUAL 1
 
index 535ca54d1d37cbd11d3ef015dd217e9343f3f24c..53d2a111c48508c3eef57a5216890ee461566bd2 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/list.h>
 #include <linux/spinlock.h>
 #include <linux/cache.h>
-#include <asm/page.h>                  /* for BUG() */
+#include <asm/bug.h>
 
 struct vfsmount;
 
index 5b1657fca68a67f8fe0565653cea9a2259bb40bc..f3e44482a2983b57508eba5f8f43512ffdc88272 100644 (file)
@@ -194,6 +194,7 @@ typedef struct journal_superblock_s
 
 #include <linux/fs.h>
 #include <linux/sched.h>
+#include <asm/bug.h>
 
 #define JBD_ASSERTIONS
 #ifdef JBD_ASSERTIONS
@@ -779,14 +780,6 @@ static inline void journal_abort_handle(handle_t *handle)
        handle->h_aborted = 1;
 }
 
-/* Not all architectures define BUG() */
-#ifndef BUG
- #define BUG() do { \
-        printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
-       * ((char *) 0) = 0; \
- } while (0)
-#endif /* BUG */
-
 #endif /* __KERNEL__   */
 
 /* Comparison functions for transaction IDs: perform comparisons using
index 7eedbb7518569abcf4f93903f398164d3fc8651a..5cd1d8dc77f788863e3e2b835738304fb0032f54 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/types.h>
 #include <linux/compiler.h>
 #include <asm/byteorder.h>
+#include <asm/bug.h>
 
 /* Optimization barrier */
 /* The "volatile" is due to gcc bugs */
index 06ac1c4f153080a451523fe10c5ada304d37cef7..ce016a544cd4d8bae01a430851dd377993da8847 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/compiler.h>
 #include <linux/threads.h>
 #include <asm/smp.h>
+#include <asm/bug.h>
 
 /*
  * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
@@ -86,7 +87,6 @@ int cpu_up(unsigned int cpu);
 void smp_prepare_boot_cpu(void);
 
 #else /* !SMP */
-#include <asm/page.h> /* For BUG() */
 
 /*
  *     These macros fold the SMP functionality into a single CPU system