summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/bug.h14
-rw-r--r--include/asm-alpha/page.h8
-rw-r--r--include/asm-arm/bug.h20
-rw-r--r--include/asm-arm/page.h15
-rw-r--r--include/asm-cris/bug.h12
-rw-r--r--include/asm-cris/page.h12
-rw-r--r--include/asm-i386/bug.h27
-rw-r--r--include/asm-i386/page.h21
-rw-r--r--include/asm-ia64/bug.h12
-rw-r--r--include/asm-ia64/page.h8
-rw-r--r--include/asm-m68k/bug.h28
-rw-r--r--include/asm-m68k/page.h22
-rw-r--r--include/asm-mips/bug.h8
-rw-r--r--include/asm-mips/page.h3
-rw-r--r--include/asm-mips64/bug.h7
-rw-r--r--include/asm-mips64/page.h3
-rw-r--r--include/asm-parisc/bug.h18
-rw-r--r--include/asm-parisc/page.h14
-rw-r--r--include/asm-ppc/bug.h21
-rw-r--r--include/asm-ppc/page.h3
-rw-r--r--include/asm-ppc/processor.h13
-rw-r--r--include/asm-s390/bug.h13
-rw-r--r--include/asm-s390/page.h9
-rw-r--r--include/asm-s390x/bug.h13
-rw-r--r--include/asm-s390x/page.h9
-rw-r--r--include/asm-sh/bug.h16
-rw-r--r--include/asm-sh/page.h12
-rw-r--r--include/asm-sparc/bug.h25
-rw-r--r--include/asm-sparc/page.h20
-rw-r--r--include/asm-sparc64/bug.h17
-rw-r--r--include/asm-sparc64/page.h12
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/jbd.h9
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/smp.h2
35 files changed, 255 insertions, 194 deletions
diff --git a/include/asm-alpha/bug.h b/include/asm-alpha/bug.h
new file mode 100644
index 000000000000..0ff718cfdf53
--- /dev/null
+++ b/include/asm-alpha/bug.h
@@ -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
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index 43e414a33d95..2602b3685fe5 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -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
index 000000000000..c9b6e7f6b317
--- /dev/null
+++ b/include/asm-arm/bug.h
@@ -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
+
diff --git a/include/asm-arm/page.h b/include/asm-arm/page.h
index 0b1a26ed991d..ca379e1f9184 100644
--- a/include/asm-arm/page.h
+++ b/include/asm-arm/page.h
@@ -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
index 000000000000..64e1d8b01f25
--- /dev/null
+++ b/include/asm-cris/bug.h
@@ -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
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index 01166c2bfd7c..47c83465c2af 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -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
index 000000000000..7a30b490e828
--- /dev/null
+++ b/include/asm-i386/bug.h
@@ -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
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 3c73ce930a0a..ebc1bf892bd3 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -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
index 000000000000..085cdb70c85e
--- /dev/null
+++ b/include/asm-ia64/bug.h
@@ -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
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 4f956057d17f..2c78c70ee477 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -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
index 000000000000..92c5cc5c3c09
--- /dev/null
+++ b/include/asm-m68k/bug.h
@@ -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
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 7ca3578dfa8f..6c09c4f01e07 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -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
index 000000000000..a66c6f97c391
--- /dev/null
+++ b/include/asm-mips/bug.h
@@ -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
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index d3fb0a1e2fde..5cd2c52cb14f 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -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
index 000000000000..3bf0774fc204
--- /dev/null
+++ b/include/asm-mips64/bug.h
@@ -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
diff --git a/include/asm-mips64/page.h b/include/asm-mips64/page.h
index 9046c3474d43..872855cea66b 100644
--- a/include/asm-mips64/page.h
+++ b/include/asm-mips64/page.h
@@ -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
index 000000000000..d810287bb4f6
--- /dev/null
+++ b/include/asm-parisc/bug.h
@@ -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
diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h
index f754c241f7dd..b5db7b3da584 100644
--- a/include/asm-parisc/page.h
+++ b/include/asm-parisc/page.h
@@ -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
index 000000000000..848c69a703b5
--- /dev/null
+++ b/include/asm-ppc/bug.h
@@ -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
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index e0429c2b5bc7..ff0f8f9acf62 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -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
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 6c7193953195..b958da9e3c13 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -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
index 000000000000..38f2940e72df
--- /dev/null
+++ b/include/asm-s390/bug.h
@@ -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
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 273b1a528af1..75ce536327d9 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -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
index 000000000000..38f2940e72df
--- /dev/null
+++ b/include/asm-s390x/bug.h
@@ -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
diff --git a/include/asm-s390x/page.h b/include/asm-s390x/page.h
index ddbed4167af4..e075af90adb2 100644
--- a/include/asm-s390x/page.h
+++ b/include/asm-s390x/page.h
@@ -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
index 000000000000..a8624ef03788
--- /dev/null
+++ b/include/asm-sh/bug.h
@@ -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
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h
index b124b63e23ce..742f66dac325 100644
--- a/include/asm-sh/page.h
+++ b/include/asm-sh/page.h
@@ -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
index 000000000000..2100cc50f97c
--- /dev/null
+++ b/include/asm-sparc/bug.h
@@ -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
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index 7e521e0c31f4..253f216f1e1e 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -29,26 +29,6 @@
#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
index 000000000000..7acd49b93509
--- /dev/null
+++ b/include/asm-sparc64/bug.h
@@ -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
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h
index 208650062ebf..2fc25cfb7be8 100644
--- a/include/asm-sparc64/page.h
+++ b/include/asm-sparc64/page.h
@@ -20,18 +20,6 @@
#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
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 535ca54d1d37..53d2a111c485 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -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;
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 5b1657fca68a..f3e44482a298 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -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
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7eedbb751856..5cd1d8dc77f7 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -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 */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 06ac1c4f1530..ce016a544cd4 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -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