From: Christoph Hellwig <hch@lst.de>

Since the irq handling rework in 2.5 lots of code in the individual
<asm/hardirq.h> files is the same.  This patch moves that common code
to <linux/hardirq.h>.  The following differences existed:

 - alpha, m68k, m68knommu and v850 were missing the ~PREEMPT_ACTIVE
   masking in the CONFIG_PREEMPT case of in_atomic().  These
   architectures don't support CONFIG_PREEMPT else this would have been
   an easily-spottbale bug
 - S390 didn't provide synchronize_irq as it doesn't fit into their
   I/O model.  They now get a spurious prototype/macro
 - ppc added a new preemptible() macro that is provided for all
   architectures now.

Most drivers were using <linux/interrupt.h> as they should, but a few
drivers and lots of architecture code has been updated to use
<linux/hardirq.h> instead of <asm/hardirq.h>

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/Documentation/DocBook/kernel-hacking.tmpl                     |    4 
 25-akpm/Documentation/firmware_class/firmware_sample_firmware_class.c |    3 
 25-akpm/arch/alpha/kernel/smp.c                                       |    1 
 25-akpm/arch/cris/kernel/crisksyms.c                                  |    1 
 25-akpm/arch/h8300/kernel/asm-offsets.c                               |    2 
 25-akpm/arch/h8300/kernel/h8300_ksyms.c                               |    1 
 25-akpm/arch/h8300/kernel/ints.c                                      |    2 
 25-akpm/arch/h8300/platform/h8s/ints.c                                |    2 
 25-akpm/arch/i386/kernel/i386_ksyms.c                                 |    1 
 25-akpm/arch/i386/lib/mmx.c                                           |    2 
 25-akpm/arch/i386/mm/fault.c                                          |    1 
 25-akpm/arch/ia64/kernel/traps.c                                      |    2 
 25-akpm/arch/ia64/mm/fault.c                                          |    1 
 25-akpm/arch/m68k/kernel/m68k_ksyms.c                                 |    1 
 25-akpm/arch/m68k/q40/q40ints.c                                       |    2 
 25-akpm/arch/m68knommu/kernel/asm-offsets.c                           |    2 
 25-akpm/arch/m68knommu/kernel/m68k_ksyms.c                            |    1 
 25-akpm/arch/mips/au1000/common/time.c                                |    2 
 25-akpm/arch/mips/kernel/smp.c                                        |    1 
 25-akpm/arch/mips/kernel/time.c                                       |    1 
 25-akpm/arch/mips/mips-boards/generic/time.c                          |    1 
 25-akpm/arch/mips/mm/fault.c                                          |    1 
 25-akpm/arch/parisc/kernel/asm-offsets.c                              |    4 
 25-akpm/arch/parisc/lib/debuglocks.c                                  |    2 
 25-akpm/arch/ppc/kernel/dma-mapping.c                                 |    2 
 25-akpm/arch/ppc/kernel/process.c                                     |    2 
 25-akpm/arch/ppc/kernel/smp.c                                         |    1 
 25-akpm/arch/ppc/platforms/chrp_smp.c                                 |    1 
 25-akpm/arch/ppc/platforms/pmac_cpufreq.c                             |    2 
 25-akpm/arch/ppc/platforms/pmac_smp.c                                 |    2 
 25-akpm/arch/ppc/platforms/pmac_time.c                                |    2 
 25-akpm/arch/ppc/syslib/open_pic.c                                    |    1 
 25-akpm/arch/ppc/syslib/open_pic2.c                                   |    1 
 25-akpm/arch/ppc64/kernel/asm-offsets.c                               |    2 
 25-akpm/arch/ppc64/kernel/pmac_smp.c                                  |    1 
 25-akpm/arch/ppc64/kernel/pmac_time.c                                 |    2 
 25-akpm/arch/ppc64/kernel/process.c                                   |    2 
 25-akpm/arch/ppc64/kernel/rtc.c                                       |    2 
 25-akpm/arch/ppc64/kernel/smp.c                                       |    1 
 25-akpm/arch/ppc64/kernel/viopath.c                                   |    2 
 25-akpm/arch/ppc64/mm/tlb.c                                           |    2 
 25-akpm/arch/s390/mm/fault.c                                          |    2 
 25-akpm/arch/sh/kernel/sh_ksyms.c                                     |    1 
 25-akpm/arch/sh/kernel/smp.c                                          |    1 
 25-akpm/arch/sh/mm/fault-nommu.c                                      |    1 
 25-akpm/arch/sh/mm/fault.c                                            |    1 
 25-akpm/arch/sh/mm/tlb-sh3.c                                          |    1 
 25-akpm/arch/sh/mm/tlb-sh4.c                                          |    1 
 25-akpm/arch/sh64/kernel/sh_ksyms.c                                   |    1 
 25-akpm/arch/sh64/mm/fault.c                                          |    1 
 25-akpm/arch/sh64/mm/tlbmiss.c                                        |    1 
 25-akpm/arch/sparc/kernel/irq.c                                       |    1 
 25-akpm/arch/sparc/kernel/setup.c                                     |    1 
 25-akpm/arch/sparc/kernel/smp.c                                       |    1 
 25-akpm/arch/sparc/kernel/sparc_ksyms.c                               |    1 
 25-akpm/arch/sparc/kernel/sun4d_smp.c                                 |    1 
 25-akpm/arch/sparc/kernel/sun4m_smp.c                                 |    1 
 25-akpm/arch/sparc64/kernel/irq.c                                     |    1 
 25-akpm/arch/sparc64/kernel/setup.c                                   |    1 
 25-akpm/arch/sparc64/kernel/smp.c                                     |    1 
 25-akpm/arch/sparc64/kernel/sparc64_ksyms.c                           |    1 
 25-akpm/arch/um/drivers/stdio_console.c                               |    2 
 25-akpm/arch/um/kernel/irq.c                                          |    2 
 25-akpm/arch/um/kernel/smp.c                                          |    2 
 25-akpm/arch/v850/kernel/asm-consts.c                                 |    2 
 25-akpm/arch/v850/kernel/v850_ksyms.c                                 |    1 
 25-akpm/arch/x86_64/kernel/asm-offsets.c                              |    2 
 25-akpm/arch/x86_64/kernel/x8664_ksyms.c                              |    1 
 25-akpm/arch/x86_64/mm/fault.c                                        |    1 
 25-akpm/crypto/internal.h                                             |    1 
 25-akpm/drivers/base/firmware_class.c                                 |    2 
 25-akpm/drivers/char/rio/linux_compat.h                               |    2 
 25-akpm/drivers/macintosh/via-pmu.c                                   |    1 
 25-akpm/drivers/s390/cio/cio.c                                        |    2 
 25-akpm/include/asm-alpha/hardirq.h                                   |   41 --------
 25-akpm/include/asm-arm/hardirq.h                                     |   38 -------
 25-akpm/include/asm-arm26/hardirq.h                                   |   35 ------
 25-akpm/include/asm-cris/hardirq.h                                    |   36 -------
 25-akpm/include/asm-generic/local.h                                   |    2 
 25-akpm/include/asm-h8300/hardirq.h                                   |   40 -------
 25-akpm/include/asm-i386/hardirq.h                                    |   42 --------
 25-akpm/include/asm-ia64/hardirq.h                                    |   41 --------
 25-akpm/include/asm-m68k/hardirq.h                                    |   36 -------
 25-akpm/include/asm-m68k/system.h                                     |    2 
 25-akpm/include/asm-m68knommu/hardirq.h                               |   46 ---------
 25-akpm/include/asm-mips/hardirq.h                                    |   40 -------
 25-akpm/include/asm-parisc/hardirq.h                                  |   42 --------
 25-akpm/include/asm-ppc/hardirq.h                                     |   44 --------
 25-akpm/include/asm-ppc64/hardirq.h                                   |   45 --------
 25-akpm/include/asm-s390/hardirq.h                                    |   42 --------
 25-akpm/include/asm-s390/irq.h                                        |    2 
 25-akpm/include/asm-sh/hardirq.h                                      |   41 --------
 25-akpm/include/asm-sparc/hardirq.h                                   |   41 --------
 25-akpm/include/asm-sparc64/hardirq.h                                 |   41 --------
 25-akpm/include/asm-v850/hardirq.h                                    |   40 -------
 25-akpm/include/asm-x86_64/hardirq.h                                  |   43 --------
 25-akpm/include/linux/hardirq.h                                       |   51 ++++++++++
 25-akpm/include/linux/interrupt.h                                     |    2 
 25-akpm/include/net/ipv6.h                                            |    2 
 25-akpm/sound/oss/ali5455.c                                           |    1 
 25-akpm/sound/oss/au1000.c                                            |    2 
 25-akpm/sound/oss/cs46xx.c                                            |    1 
 25-akpm/sound/oss/forte.c                                             |    1 
 25-akpm/sound/oss/i810_audio.c                                        |    1 
 25-akpm/sound/oss/ite8172.c                                           |    2 
 25-akpm/sound/oss/nec_vrc5477.c                                       |    1 
 25-akpm/sound/oss/rme96xx.c                                           |    2 
 25-akpm/sound/oss/swarm_cs4297a.c                                     |    2 
 25-akpm/sound/oss/trident.c                                           |    1 
 109 files changed, 100 insertions(+), 860 deletions(-)

diff -puN arch/alpha/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/alpha/kernel/smp.c
--- 25/arch/alpha/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.140481048 -0700
+++ 25-akpm/arch/alpha/kernel/smp.c	2004-09-02 16:06:46.301456576 -0700
@@ -36,7 +36,6 @@
 #include <asm/bitops.h>
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/tlbflush.h>
 
diff -puN arch/cris/kernel/crisksyms.c~factor-out-common-asm-hardirqh-code arch/cris/kernel/crisksyms.c
--- 25/arch/cris/kernel/crisksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.141480896 -0700
+++ 25-akpm/arch/cris/kernel/crisksyms.c	2004-09-02 16:06:46.302456424 -0700
@@ -16,7 +16,6 @@
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
 #include <asm/io.h>
-#include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/irq.h>
 #include <asm/pgtable.h>
diff -puN arch/h8300/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code arch/h8300/kernel/asm-offsets.c
--- 25/arch/h8300/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.143480592 -0700
+++ 25-akpm/arch/h8300/kernel/asm-offsets.c	2004-09-02 16:06:46.302456424 -0700
@@ -12,9 +12,9 @@
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <linux/ptrace.h>
+#include <linux/hardirq.h>
 #include <asm/bootinfo.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 #include <asm/ptrace.h>
 
 #define DEFINE(sym, val) \
diff -puN arch/h8300/kernel/h8300_ksyms.c~factor-out-common-asm-hardirqh-code arch/h8300/kernel/h8300_ksyms.c
--- 25/arch/h8300/kernel/h8300_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.144480440 -0700
+++ 25-akpm/arch/h8300/kernel/h8300_ksyms.c	2004-09-02 16:06:46.302456424 -0700
@@ -15,7 +15,6 @@
 #include <asm/io.h>
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
-#include <asm/hardirq.h>
 #include <asm/current.h>
 #include <asm/gpio.h>
 
diff -puN arch/h8300/kernel/ints.c~factor-out-common-asm-hardirqh-code arch/h8300/kernel/ints.c
--- 25/arch/h8300/kernel/ints.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.145480288 -0700
+++ 25-akpm/arch/h8300/kernel/ints.c	2004-09-02 16:06:46.303456272 -0700
@@ -22,13 +22,13 @@
 #include <linux/init.h>
 #include <linux/random.h>
 #include <linux/bootmem.h>
+#include <linux/hardirq.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/traps.h>
 #include <asm/io.h>
 #include <asm/setup.h>
-#include <asm/hardirq.h>
 #include <asm/errno.h>
 
 /*
diff -puN arch/h8300/platform/h8s/ints.c~factor-out-common-asm-hardirqh-code arch/h8300/platform/h8s/ints.c
--- 25/arch/h8300/platform/h8s/ints.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.147479984 -0700
+++ 25-akpm/arch/h8300/platform/h8s/ints.c	2004-09-02 16:06:46.303456272 -0700
@@ -22,6 +22,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/random.h>
+#include <linux/hardirq.h>
 
 #include <asm/system.h>
 #include <asm/irq.h>
@@ -29,7 +30,6 @@
 #include <asm/io.h>
 #include <asm/setup.h>
 #include <asm/gpio.h>
-#include <asm/hardirq.h>
 #include <asm/regs267x.h>
 #include <asm/errno.h>
 
diff -puN arch/i386/kernel/i386_ksyms.c~factor-out-common-asm-hardirqh-code arch/i386/kernel/i386_ksyms.c
--- 25/arch/i386/kernel/i386_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.148479832 -0700
+++ 25-akpm/arch/i386/kernel/i386_ksyms.c	2004-09-02 16:06:46.303456272 -0700
@@ -23,7 +23,6 @@
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
 #include <asm/io.h>
-#include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/irq.h>
 #include <asm/mmx.h>
diff -puN arch/i386/lib/mmx.c~factor-out-common-asm-hardirqh-code arch/i386/lib/mmx.c
--- 25/arch/i386/lib/mmx.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.149479680 -0700
+++ 25-akpm/arch/i386/lib/mmx.c	2004-09-02 16:06:46.304456120 -0700
@@ -2,9 +2,9 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/sched.h>
+#include <linux/hardirq.h> 
 
 #include <asm/i387.h>
-#include <asm/hardirq.h> 
 
 
 /*
diff -puN arch/i386/mm/fault.c~factor-out-common-asm-hardirqh-code arch/i386/mm/fault.c
--- 25/arch/i386/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.151479376 -0700
+++ 25-akpm/arch/i386/mm/fault.c	2004-09-02 16:06:46.304456120 -0700
@@ -24,7 +24,6 @@
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/desc.h>
 #include <asm/kdebug.h>
 
diff -puN arch/ia64/kernel/traps.c~factor-out-common-asm-hardirqh-code arch/ia64/kernel/traps.c
--- 25/arch/ia64/kernel/traps.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.152479224 -0700
+++ 25-akpm/arch/ia64/kernel/traps.c	2004-09-02 16:06:46.305455968 -0700
@@ -14,9 +14,9 @@
 #include <linux/tty.h>
 #include <linux/vt_kern.h>		/* For unblank_screen() */
 #include <linux/module.h>       /* for EXPORT_SYMBOL */
+#include <linux/hardirq.h>
 
 #include <asm/fpswa.h>
-#include <asm/hardirq.h>
 #include <asm/ia32.h>
 #include <asm/intrinsics.h>
 #include <asm/processor.h>
diff -puN arch/ia64/mm/fault.c~factor-out-common-asm-hardirqh-code arch/ia64/mm/fault.c
--- 25/arch/ia64/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.153479072 -0700
+++ 25-akpm/arch/ia64/mm/fault.c	2004-09-02 16:06:59.169500336 -0700
@@ -14,7 +14,6 @@
 #include <asm/processor.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/kgdb.h>
 
 extern void die (char *, struct pt_regs *, long);
diff -puN arch/m68k/kernel/m68k_ksyms.c~factor-out-common-asm-hardirqh-code arch/m68k/kernel/m68k_ksyms.c
--- 25/arch/m68k/kernel/m68k_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.155478768 -0700
+++ 25-akpm/arch/m68k/kernel/m68k_ksyms.c	2004-09-02 16:06:46.306455816 -0700
@@ -16,7 +16,6 @@
 #include <asm/io.h>
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
-#include <asm/hardirq.h>
 
 asmlinkage long long __ashldi3 (long long, int);
 asmlinkage long long __ashrdi3 (long long, int);
diff -puN arch/m68knommu/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code arch/m68knommu/kernel/asm-offsets.c
--- 25/arch/m68knommu/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.156478616 -0700
+++ 25-akpm/arch/m68knommu/kernel/asm-offsets.c	2004-09-02 16:06:46.307455664 -0700
@@ -12,9 +12,9 @@
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <linux/ptrace.h>
+#include <linux/hardirq.h>
 #include <asm/bootinfo.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 
 #define DEFINE(sym, val) \
         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
diff -puN arch/m68knommu/kernel/m68k_ksyms.c~factor-out-common-asm-hardirqh-code arch/m68knommu/kernel/m68k_ksyms.c
--- 25/arch/m68knommu/kernel/m68k_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.157478464 -0700
+++ 25-akpm/arch/m68knommu/kernel/m68k_ksyms.c	2004-09-02 16:06:46.307455664 -0700
@@ -16,7 +16,6 @@
 #include <asm/io.h>
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
-#include <asm/hardirq.h>
 #include <asm/current.h>
 
 extern void dump_thread(struct pt_regs *, struct user *);
diff -puN arch/m68k/q40/q40ints.c~factor-out-common-asm-hardirqh-code arch/m68k/q40/q40ints.c
--- 25/arch/m68k/q40/q40ints.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.159478160 -0700
+++ 25-akpm/arch/m68k/q40/q40ints.c	2004-09-02 16:06:46.307455664 -0700
@@ -19,12 +19,12 @@
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/interrupt.h>
+#include <linux/hardirq.h>
 
 #include <asm/rtc.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 #include <asm/traps.h>
 
 #include <asm/q40_master.h>
diff -puN arch/mips/au1000/common/time.c~factor-out-common-asm-hardirqh-code arch/mips/au1000/common/time.c
--- 25/arch/mips/au1000/common/time.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.160478008 -0700
+++ 25-akpm/arch/mips/au1000/common/time.c	2004-09-02 16:06:46.308455512 -0700
@@ -38,11 +38,11 @@
 #include <linux/kernel_stat.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
+#include <linux/hardirq.h>
 
 #include <asm/mipsregs.h>
 #include <asm/ptrace.h>
 #include <asm/time.h>
-#include <asm/hardirq.h>
 #include <asm/div64.h>
 #include <asm/mach-au1x00/au1000.h>
 
diff -puN arch/mips/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/mips/kernel/smp.c
--- 25/arch/mips/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.161477856 -0700
+++ 25-akpm/arch/mips/kernel/smp.c	2004-09-02 16:06:46.309455360 -0700
@@ -35,7 +35,6 @@
 #include <asm/cpu.h>
 #include <asm/processor.h>
 #include <asm/system.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/smp.h>
 
diff -puN arch/mips/kernel/time.c~factor-out-common-asm-hardirqh-code arch/mips/kernel/time.c
--- 25/arch/mips/kernel/time.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.163477552 -0700
+++ 25-akpm/arch/mips/kernel/time.c	2004-09-02 16:06:46.310455208 -0700
@@ -29,7 +29,6 @@
 #include <asm/cpu.h>
 #include <asm/cpu-features.h>
 #include <asm/div64.h>
-#include <asm/hardirq.h>
 #include <asm/sections.h>
 #include <asm/time.h>
 
diff -puN arch/mips/mips-boards/generic/time.c~factor-out-common-asm-hardirqh-code arch/mips/mips-boards/generic/time.c
--- 25/arch/mips/mips-boards/generic/time.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.164477400 -0700
+++ 25-akpm/arch/mips/mips-boards/generic/time.c	2004-09-02 16:06:46.310455208 -0700
@@ -31,7 +31,6 @@
 
 #include <asm/mipsregs.h>
 #include <asm/ptrace.h>
-#include <asm/hardirq.h>
 #include <asm/div64.h>
 #include <asm/cpu.h>
 #include <asm/time.h>
diff -puN arch/mips/mm/fault.c~factor-out-common-asm-hardirqh-code arch/mips/mm/fault.c
--- 25/arch/mips/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.165477248 -0700
+++ 25-akpm/arch/mips/mm/fault.c	2004-09-02 16:06:46.311455056 -0700
@@ -21,7 +21,6 @@
 #include <linux/module.h>
 
 #include <asm/branch.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
diff -puN arch/parisc/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code arch/parisc/kernel/asm-offsets.c
--- 25/arch/parisc/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.167476944 -0700
+++ 25-akpm/arch/parisc/kernel/asm-offsets.c	2004-09-02 16:06:46.311455056 -0700
@@ -32,11 +32,11 @@
 #include <linux/thread_info.h>
 #include <linux/version.h>
 #include <linux/ptrace.h>
-#include <asm/pgtable.h>
+#include <linux/hardirq.h>
 
+#include <asm/pgtable.h>
 #include <asm/ptrace.h>
 #include <asm/processor.h>
-#include <asm/hardirq.h>
 #include <asm/pdc.h>
 
 #define DEFINE(sym, val) \
diff -puN arch/parisc/lib/debuglocks.c~factor-out-common-asm-hardirqh-code arch/parisc/lib/debuglocks.c
--- 25/arch/parisc/lib/debuglocks.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.168476792 -0700
+++ 25-akpm/arch/parisc/lib/debuglocks.c	2004-09-02 16:06:46.312454904 -0700
@@ -25,8 +25,8 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
+#include <linux/hardirq.h>	/* in_interrupt() */
 #include <asm/system.h>
-#include <asm/hardirq.h>	/* in_interrupt() */
 
 #undef INIT_STUCK
 #define INIT_STUCK 1L << 30
diff -puN arch/ppc64/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/asm-offsets.c
--- 25/arch/ppc64/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.169476640 -0700
+++ 25-akpm/arch/ppc64/kernel/asm-offsets.c	2004-09-02 16:06:46.317454144 -0700
@@ -22,11 +22,11 @@
 #include <linux/types.h>
 #include <linux/mman.h>
 #include <linux/mm.h>
+#include <linux/hardirq.h>
 #include <asm/io.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/processor.h>
-#include <asm/hardirq.h>
 
 #include <asm/naca.h>
 #include <asm/paca.h>
diff -puN arch/ppc64/kernel/pmac_smp.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/pmac_smp.c
--- 25/arch/ppc64/kernel/pmac_smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.171476336 -0700
+++ 25-akpm/arch/ppc64/kernel/pmac_smp.c	2004-09-02 16:06:46.317454144 -0700
@@ -38,7 +38,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
diff -puN arch/ppc64/kernel/pmac_time.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/pmac_time.c
--- 25/arch/ppc64/kernel/pmac_time.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.172476184 -0700
+++ 25-akpm/arch/ppc64/kernel/pmac_time.c	2004-09-02 16:06:46.318453992 -0700
@@ -18,6 +18,7 @@
 #include <linux/time.h>
 #include <linux/adb.h>
 #include <linux/pmu.h>
+#include <linux/interrupt.h>
 
 #include <asm/sections.h>
 #include <asm/prom.h>
@@ -25,7 +26,6 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/machdep.h>
-#include <asm/hardirq.h>
 #include <asm/time.h>
 #include <asm/nvram.h>
 
diff -puN arch/ppc64/kernel/process.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/process.c
--- 25/arch/ppc64/kernel/process.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.173476032 -0700
+++ 25-akpm/arch/ppc64/kernel/process.c	2004-09-02 16:06:46.318453992 -0700
@@ -34,6 +34,7 @@
 #include <linux/prctl.h>
 #include <linux/ptrace.h>
 #include <linux/kallsyms.h>
+#include <linux/interrupt.h>
 #include <linux/version.h>
 
 #include <asm/pgtable.h>
@@ -47,7 +48,6 @@
 #include <asm/ppcdebug.h>
 #include <asm/machdep.h>
 #include <asm/iSeries/HvCallHpt.h>
-#include <asm/hardirq.h>
 #include <asm/cputable.h>
 #include <asm/sections.h>
 #include <asm/tlbflush.h>
diff -puN arch/ppc64/kernel/rtc.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/rtc.c
--- 25/arch/ppc64/kernel/rtc.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.175475728 -0700
+++ 25-akpm/arch/ppc64/kernel/rtc.c	2004-09-02 16:06:46.319453840 -0700
@@ -34,8 +34,8 @@
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
 #include <linux/bcd.h>
+#include <linux/interrupt.h>
 
-#include <asm/hardirq.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
diff -puN arch/ppc64/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/smp.c
--- 25/arch/ppc64/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.176475576 -0700
+++ 25-akpm/arch/ppc64/kernel/smp.c	2004-09-02 16:06:46.320453688 -0700
@@ -36,7 +36,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
diff -puN arch/ppc64/kernel/viopath.c~factor-out-common-asm-hardirqh-code arch/ppc64/kernel/viopath.c
--- 25/arch/ppc64/kernel/viopath.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.178475272 -0700
+++ 25-akpm/arch/ppc64/kernel/viopath.c	2004-09-02 16:06:46.320453688 -0700
@@ -38,8 +38,8 @@
 #include <linux/wait.h>
 #include <linux/seq_file.h>
 #include <linux/smp_lock.h>
+#include <linux/interrupt.h>
 
-#include <asm/hardirq.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/iSeries/LparData.h>
diff -puN arch/ppc64/mm/tlb.c~factor-out-common-asm-hardirqh-code arch/ppc64/mm/tlb.c
--- 25/arch/ppc64/mm/tlb.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.179475120 -0700
+++ 25-akpm/arch/ppc64/mm/tlb.c	2004-09-02 16:06:46.321453536 -0700
@@ -26,10 +26,10 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/percpu.h>
+#include <linux/hardirq.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
 #include <asm/tlb.h>
-#include <asm/hardirq.h>
 #include <linux/highmem.h>
 
 DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
diff -puN arch/ppc/kernel/dma-mapping.c~factor-out-common-asm-hardirqh-code arch/ppc/kernel/dma-mapping.c
--- 25/arch/ppc/kernel/dma-mapping.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.180474968 -0700
+++ 25-akpm/arch/ppc/kernel/dma-mapping.c	2004-09-02 16:06:46.312454904 -0700
@@ -41,11 +41,11 @@
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
 #include <linux/dma-mapping.h>
+#include <linux/hardirq.h>
 
 #include <asm/pgalloc.h>
 #include <asm/prom.h>
 #include <asm/io.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/pgtable.h>
 #include <asm/mmu.h>
diff -puN arch/ppc/kernel/process.c~factor-out-common-asm-hardirqh-code arch/ppc/kernel/process.c
--- 25/arch/ppc/kernel/process.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.182474664 -0700
+++ 25-akpm/arch/ppc/kernel/process.c	2004-09-02 16:06:46.313454752 -0700
@@ -36,6 +36,7 @@
 #include <linux/module.h>
 #include <linux/kallsyms.h>
 #include <linux/mqueue.h>
+#include <linux/hardirq.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
@@ -44,7 +45,6 @@
 #include <asm/processor.h>
 #include <asm/mmu.h>
 #include <asm/prom.h>
-#include <asm/hardirq.h>
 
 extern unsigned long _get_SP(void);
 
diff -puN arch/ppc/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/ppc/kernel/smp.c
--- 25/arch/ppc/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.183474512 -0700
+++ 25-akpm/arch/ppc/kernel/smp.c	2004-09-02 16:06:46.313454752 -0700
@@ -26,7 +26,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/smp.h>
diff -puN arch/ppc/platforms/chrp_smp.c~factor-out-common-asm-hardirqh-code arch/ppc/platforms/chrp_smp.c
--- 25/arch/ppc/platforms/chrp_smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.184474360 -0700
+++ 25-akpm/arch/ppc/platforms/chrp_smp.c	2004-09-02 16:06:46.313454752 -0700
@@ -24,7 +24,6 @@
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
diff -puN arch/ppc/platforms/pmac_cpufreq.c~factor-out-common-asm-hardirqh-code arch/ppc/platforms/pmac_cpufreq.c
--- 25/arch/ppc/platforms/pmac_cpufreq.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.186474056 -0700
+++ 25-akpm/arch/ppc/platforms/pmac_cpufreq.c	2004-09-02 16:06:46.314454600 -0700
@@ -24,10 +24,10 @@
 #include <linux/init.h>
 #include <linux/sysdev.h>
 #include <linux/i2c.h>
+#include <linux/hardirq.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 #include <asm/pmac_feature.h>
 #include <asm/mmu_context.h>
 #include <asm/sections.h>
diff -puN arch/ppc/platforms/pmac_smp.c~factor-out-common-asm-hardirqh-code arch/ppc/platforms/pmac_smp.c
--- 25/arch/ppc/platforms/pmac_smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.187473904 -0700
+++ 25-akpm/arch/ppc/platforms/pmac_smp.c	2004-09-02 16:06:46.315454448 -0700
@@ -32,13 +32,13 @@
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/errno.h>
+#include <linux/hardirq.h>
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/prom.h>
diff -puN arch/ppc/platforms/pmac_time.c~factor-out-common-asm-hardirqh-code arch/ppc/platforms/pmac_time.c
--- 25/arch/ppc/platforms/pmac_time.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.189473600 -0700
+++ 25-akpm/arch/ppc/platforms/pmac_time.c	2004-09-02 16:06:46.315454448 -0700
@@ -19,6 +19,7 @@
 #include <linux/adb.h>
 #include <linux/cuda.h>
 #include <linux/pmu.h>
+#include <linux/hardirq.h>
 
 #include <asm/sections.h>
 #include <asm/prom.h>
@@ -26,7 +27,6 @@
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/machdep.h>
-#include <asm/hardirq.h>
 #include <asm/time.h>
 #include <asm/nvram.h>
 
diff -puN arch/ppc/syslib/open_pic2.c~factor-out-common-asm-hardirqh-code arch/ppc/syslib/open_pic2.c
--- 25/arch/ppc/syslib/open_pic2.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.190473448 -0700
+++ 25-akpm/arch/ppc/syslib/open_pic2.c	2004-09-02 16:06:46.317454144 -0700
@@ -28,7 +28,6 @@
 #include <asm/sections.h>
 #include <asm/open_pic.h>
 #include <asm/i8259.h>
-#include <asm/hardirq.h>
 
 #include "open_pic_defs.h"
 
diff -puN arch/ppc/syslib/open_pic.c~factor-out-common-asm-hardirqh-code arch/ppc/syslib/open_pic.c
--- 25/arch/ppc/syslib/open_pic.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.191473296 -0700
+++ 25-akpm/arch/ppc/syslib/open_pic.c	2004-09-02 16:06:46.316454296 -0700
@@ -24,7 +24,6 @@
 #include <asm/sections.h>
 #include <asm/open_pic.h>
 #include <asm/i8259.h>
-#include <asm/hardirq.h>
 
 #include "open_pic_defs.h"
 
diff -puN arch/s390/mm/fault.c~factor-out-common-asm-hardirqh-code arch/s390/mm/fault.c
--- 25/arch/s390/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.193472992 -0700
+++ 25-akpm/arch/s390/mm/fault.c	2004-09-02 16:06:46.321453536 -0700
@@ -25,11 +25,11 @@
 #include <linux/init.h>
 #include <linux/console.h>
 #include <linux/module.h>
+#include <linux/hardirq.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 
 #ifndef CONFIG_ARCH_S390X
 #define __FAIL_ADDR_MASK 0x7ffff000
diff -puN arch/sh64/kernel/sh_ksyms.c~factor-out-common-asm-hardirqh-code arch/sh64/kernel/sh_ksyms.c
--- 25/arch/sh64/kernel/sh_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.194472840 -0700
+++ 25-akpm/arch/sh64/kernel/sh_ksyms.c	2004-09-02 16:06:46.324453080 -0700
@@ -25,7 +25,6 @@
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
 #include <asm/io.h>
-#include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/irq.h>
 
diff -puN arch/sh64/mm/fault.c~factor-out-common-asm-hardirqh-code arch/sh64/mm/fault.c
--- 25/arch/sh64/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.195472688 -0700
+++ 25-akpm/arch/sh64/mm/fault.c	2004-09-02 16:06:46.325452928 -0700
@@ -30,7 +30,6 @@
 #include <asm/tlb.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/registers.h>		/* required by inline asm statements */
 
diff -puN arch/sh64/mm/tlbmiss.c~factor-out-common-asm-hardirqh-code arch/sh64/mm/tlbmiss.c
--- 25/arch/sh64/mm/tlbmiss.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.197472384 -0700
+++ 25-akpm/arch/sh64/mm/tlbmiss.c	2004-09-02 16:06:46.325452928 -0700
@@ -40,7 +40,6 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/registers.h>		/* required by inline asm statements */
 
diff -puN arch/sh/kernel/sh_ksyms.c~factor-out-common-asm-hardirqh-code arch/sh/kernel/sh_ksyms.c
--- 25/arch/sh/kernel/sh_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.198472232 -0700
+++ 25-akpm/arch/sh/kernel/sh_ksyms.c	2004-09-02 16:06:46.322453384 -0700
@@ -16,7 +16,6 @@
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
 #include <asm/io.h>
-#include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
diff -puN arch/sh/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/sh/kernel/smp.c
--- 25/arch/sh/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.199472080 -0700
+++ 25-akpm/arch/sh/kernel/smp.c	2004-09-02 16:06:46.322453384 -0700
@@ -26,7 +26,6 @@
 #include <asm/atomic.h>
 #include <asm/processor.h>
 #include <asm/system.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/smp.h>
 
diff -puN arch/sh/mm/fault.c~factor-out-common-asm-hardirqh-code arch/sh/mm/fault.c
--- 25/arch/sh/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.201471776 -0700
+++ 25-akpm/arch/sh/mm/fault.c	2004-09-02 16:06:46.323453232 -0700
@@ -26,7 +26,6 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 #include <asm/kgdb.h>
diff -puN arch/sh/mm/fault-nommu.c~factor-out-common-asm-hardirqh-code arch/sh/mm/fault-nommu.c
--- 25/arch/sh/mm/fault-nommu.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.202471624 -0700
+++ 25-akpm/arch/sh/mm/fault-nommu.c	2004-09-02 16:06:46.323453232 -0700
@@ -26,7 +26,6 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 
diff -puN arch/sh/mm/tlb-sh3.c~factor-out-common-asm-hardirqh-code arch/sh/mm/tlb-sh3.c
--- 25/arch/sh/mm/tlb-sh3.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.203471472 -0700
+++ 25-akpm/arch/sh/mm/tlb-sh3.c	2004-09-02 16:06:46.324453080 -0700
@@ -25,7 +25,6 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 
diff -puN arch/sh/mm/tlb-sh4.c~factor-out-common-asm-hardirqh-code arch/sh/mm/tlb-sh4.c
--- 25/arch/sh/mm/tlb-sh4.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.204471320 -0700
+++ 25-akpm/arch/sh/mm/tlb-sh4.c	2004-09-02 16:06:46.324453080 -0700
@@ -25,7 +25,6 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 
diff -puN arch/sparc64/kernel/irq.c~factor-out-common-asm-hardirqh-code arch/sparc64/kernel/irq.c
--- 25/arch/sparc64/kernel/irq.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.206471016 -0700
+++ 25-akpm/arch/sparc64/kernel/irq.c	2004-09-02 16:06:46.330452168 -0700
@@ -33,7 +33,6 @@
 #include <asm/oplib.h>
 #include <asm/timer.h>
 #include <asm/smp.h>
-#include <asm/hardirq.h>
 #include <asm/starfire.h>
 #include <asm/uaccess.h>
 #include <asm/cache.h>
diff -puN arch/sparc64/kernel/setup.c~factor-out-common-asm-hardirqh-code arch/sparc64/kernel/setup.c
--- 25/arch/sparc64/kernel/setup.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.207470864 -0700
+++ 25-akpm/arch/sparc64/kernel/setup.c	2004-09-02 16:06:46.330452168 -0700
@@ -43,7 +43,6 @@
 #include <asm/idprom.h>
 #include <asm/head.h>
 #include <asm/starfire.h>
-#include <asm/hardirq.h>
 #include <asm/mmu_context.h>
 #include <asm/timer.h>
 #include <asm/sections.h>
diff -puN arch/sparc64/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/sparc64/kernel/smp.c
--- 25/arch/sparc64/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.208470712 -0700
+++ 25-akpm/arch/sparc64/kernel/smp.c	2004-09-02 16:06:46.331452016 -0700
@@ -32,7 +32,6 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/oplib.h>
-#include <asm/hardirq.h>
 #include <asm/uaccess.h>
 #include <asm/timer.h>
 #include <asm/starfire.h>
diff -puN arch/sparc64/kernel/sparc64_ksyms.c~factor-out-common-asm-hardirqh-code arch/sparc64/kernel/sparc64_ksyms.c
--- 25/arch/sparc64/kernel/sparc64_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.210470408 -0700
+++ 25-akpm/arch/sparc64/kernel/sparc64_ksyms.c	2004-09-02 16:06:46.332451864 -0700
@@ -34,7 +34,6 @@
 #include <asm/pgtable.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 #include <asm/idprom.h>
 #include <asm/svr4.h>
 #include <asm/elf.h>
diff -puN arch/sparc/kernel/irq.c~factor-out-common-asm-hardirqh-code arch/sparc/kernel/irq.c
--- 25/arch/sparc/kernel/irq.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.211470256 -0700
+++ 25-akpm/arch/sparc/kernel/irq.c	2004-09-02 16:06:46.326452776 -0700
@@ -45,7 +45,6 @@
 #include <asm/io.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
-#include <asm/hardirq.h>
 #include <asm/pcic.h>
 #include <asm/cacheflush.h>
 
diff -puN arch/sparc/kernel/setup.c~factor-out-common-asm-hardirqh-code arch/sparc/kernel/setup.c
--- 25/arch/sparc/kernel/setup.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.213469952 -0700
+++ 25-akpm/arch/sparc/kernel/setup.c	2004-09-02 16:06:46.327452624 -0700
@@ -44,7 +44,6 @@
 #include <asm/kdebug.h>
 #include <asm/mbus.h>
 #include <asm/idprom.h>
-#include <asm/hardirq.h>
 #include <asm/machines.h>
 #include <asm/cpudata.h>
 #include <asm/setup.h>
diff -puN arch/sparc/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/sparc/kernel/smp.c
--- 25/arch/sparc/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.214469800 -0700
+++ 25-akpm/arch/sparc/kernel/smp.c	2004-09-02 16:06:46.327452624 -0700
@@ -30,7 +30,6 @@
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/oplib.h>
-#include <asm/hardirq.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/cpudata.h>
diff -puN arch/sparc/kernel/sparc_ksyms.c~factor-out-common-asm-hardirqh-code arch/sparc/kernel/sparc_ksyms.c
--- 25/arch/sparc/kernel/sparc_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.215469648 -0700
+++ 25-akpm/arch/sparc/kernel/sparc_ksyms.c	2004-09-02 16:06:46.328452472 -0700
@@ -41,7 +41,6 @@
 #include <asm/smp.h>
 #include <asm/mostek.h>
 #include <asm/ptrace.h>
-#include <asm/hardirq.h>
 #include <asm/user.h>
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
diff -puN arch/sparc/kernel/sun4d_smp.c~factor-out-common-asm-hardirqh-code arch/sparc/kernel/sun4d_smp.c
--- 25/arch/sparc/kernel/sun4d_smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.217469344 -0700
+++ 25-akpm/arch/sparc/kernel/sun4d_smp.c	2004-09-02 16:06:46.328452472 -0700
@@ -30,7 +30,6 @@
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/oplib.h>
-#include <asm/hardirq.h>
 #include <asm/sbus.h>
 #include <asm/sbi.h>
 #include <asm/tlbflush.h>
diff -puN arch/sparc/kernel/sun4m_smp.c~factor-out-common-asm-hardirqh-code arch/sparc/kernel/sun4m_smp.c
--- 25/arch/sparc/kernel/sun4m_smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.218469192 -0700
+++ 25-akpm/arch/sparc/kernel/sun4m_smp.c	2004-09-02 16:06:46.329452320 -0700
@@ -29,7 +29,6 @@
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/oplib.h>
-#include <asm/hardirq.h>
 #include <asm/cpudata.h>
 
 #define IRQ_RESCHEDULE		13
diff -puN arch/um/drivers/stdio_console.c~factor-out-common-asm-hardirqh-code arch/um/drivers/stdio_console.c
--- 25/arch/um/drivers/stdio_console.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.219469040 -0700
+++ 25-akpm/arch/um/drivers/stdio_console.c	2004-09-02 16:06:46.333451712 -0700
@@ -17,8 +17,8 @@
 #include "linux/init.h"
 #include "linux/interrupt.h"
 #include "linux/slab.h"
+#include "linux/hardirq.h"
 #include "asm/current.h"
-#include "asm/hardirq.h"
 #include "asm/irq.h"
 #include "stdio_console.h"
 #include "line.h"
diff -puN arch/um/kernel/irq.c~factor-out-common-asm-hardirqh-code arch/um/kernel/irq.c
--- 25/arch/um/kernel/irq.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.221468736 -0700
+++ 25-akpm/arch/um/kernel/irq.c	2004-09-02 16:06:46.333451712 -0700
@@ -19,9 +19,9 @@
 #include "linux/init.h"
 #include "linux/seq_file.h"
 #include "linux/profile.h"
+#include "linux/hardirq.h"
 #include "asm/irq.h"
 #include "asm/hw_irq.h"
-#include "asm/hardirq.h"
 #include "asm/atomic.h"
 #include "asm/signal.h"
 #include "asm/system.h"
diff -puN arch/um/kernel/smp.c~factor-out-common-asm-hardirqh-code arch/um/kernel/smp.c
--- 25/arch/um/kernel/smp.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.222468584 -0700
+++ 25-akpm/arch/um/kernel/smp.c	2004-09-02 16:06:46.334451560 -0700
@@ -18,10 +18,10 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_ga
 #include "linux/threads.h"
 #include "linux/interrupt.h"
 #include "linux/err.h"
+#include "linux/hardirq.h"
 #include "asm/smp.h"
 #include "asm/processor.h"
 #include "asm/spinlock.h"
-#include "asm/hardirq.h"
 #include "user_util.h"
 #include "kern_util.h"
 #include "kern.h"
diff -puN arch/v850/kernel/asm-consts.c~factor-out-common-asm-hardirqh-code arch/v850/kernel/asm-consts.c
--- 25/arch/v850/kernel/asm-consts.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.223468432 -0700
+++ 25-akpm/arch/v850/kernel/asm-consts.c	2004-09-02 16:06:46.334451560 -0700
@@ -12,8 +12,8 @@
 #include <linux/sched.h>
 #include <linux/kernel_stat.h>
 #include <linux/ptrace.h>
+#include <linux/hardirq.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 #include <asm/errno.h>
 
 #define DEFINE(sym, val) \
diff -puN arch/v850/kernel/v850_ksyms.c~factor-out-common-asm-hardirqh-code arch/v850/kernel/v850_ksyms.c
--- 25/arch/v850/kernel/v850_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.225468128 -0700
+++ 25-akpm/arch/v850/kernel/v850_ksyms.c	2004-09-02 16:06:46.334451560 -0700
@@ -14,7 +14,6 @@
 #include <asm/io.h>
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
-#include <asm/hardirq.h>
 #include <asm/current.h>
 
 
diff -puN arch/x86_64/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code arch/x86_64/kernel/asm-offsets.c
--- 25/arch/x86_64/kernel/asm-offsets.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.226467976 -0700
+++ 25-akpm/arch/x86_64/kernel/asm-offsets.c	2004-09-02 16:06:46.335451408 -0700
@@ -7,8 +7,8 @@
 #include <linux/sched.h> 
 #include <linux/stddef.h>
 #include <linux/errno.h> 
+#include <linux/hardirq.h>
 #include <asm/pda.h>
-#include <asm/hardirq.h>
 #include <asm/processor.h>
 #include <asm/segment.h>
 #include <asm/thread_info.h>
diff -puN arch/x86_64/kernel/x8664_ksyms.c~factor-out-common-asm-hardirqh-code arch/x86_64/kernel/x8664_ksyms.c
--- 25/arch/x86_64/kernel/x8664_ksyms.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.227467824 -0700
+++ 25-akpm/arch/x86_64/kernel/x8664_ksyms.c	2004-09-02 16:06:46.335451408 -0700
@@ -21,7 +21,6 @@
 #include <asm/uaccess.h>
 #include <asm/checksum.h>
 #include <asm/io.h>
-#include <asm/hardirq.h>
 #include <asm/delay.h>
 #include <asm/irq.h>
 #include <asm/mmx.h>
diff -puN arch/x86_64/mm/fault.c~factor-out-common-asm-hardirqh-code arch/x86_64/mm/fault.c
--- 25/arch/x86_64/mm/fault.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.229467520 -0700
+++ 25-akpm/arch/x86_64/mm/fault.c	2004-09-02 16:06:46.336451256 -0700
@@ -27,7 +27,6 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/pgalloc.h>
-#include <asm/hardirq.h>
 #include <asm/smp.h>
 #include <asm/tlbflush.h>
 #include <asm/proto.h>
diff -puN crypto/internal.h~factor-out-common-asm-hardirqh-code crypto/internal.h
--- 25/crypto/internal.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.230467368 -0700
+++ 25-akpm/crypto/internal.h	2004-09-02 16:06:46.336451256 -0700
@@ -17,7 +17,6 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/kmod.h>
-#include <asm/hardirq.h>
 #include <asm/kmap_types.h>
 
 extern enum km_type crypto_km_types[];
diff -puN Documentation/DocBook/kernel-hacking.tmpl~factor-out-common-asm-hardirqh-code Documentation/DocBook/kernel-hacking.tmpl
--- 25/Documentation/DocBook/kernel-hacking.tmpl~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.231467216 -0700
+++ 25-akpm/Documentation/DocBook/kernel-hacking.tmpl	2004-09-02 16:06:46.300456728 -0700
@@ -145,7 +145,7 @@
     In user context, the <varname>current</varname> pointer (indicating 
     the task we are currently executing) is valid, and
     <function>in_interrupt()</function>
-    (<filename>include/asm/hardirq.h</filename>) is <returnvalue>false
+    (<filename>include/linux/interrupt.h</filename>) is <returnvalue>false
     </returnvalue>.  
    </para>
 
@@ -241,7 +241,7 @@
    <para>
     You can tell you are in a softirq (or bottom half, or tasklet)
     using the <function>in_softirq()</function> macro 
-    (<filename class="headerfile">include/asm/hardirq.h</filename>).
+    (<filename class="headerfile">include/linux/interrupt.h</filename>).
    </para>
    <caution>
     <para>
diff -puN Documentation/firmware_class/firmware_sample_firmware_class.c~factor-out-common-asm-hardirqh-code Documentation/firmware_class/firmware_sample_firmware_class.c
--- 25/Documentation/firmware_class/firmware_sample_firmware_class.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.233466912 -0700
+++ 25-akpm/Documentation/firmware_class/firmware_sample_firmware_class.c	2004-09-02 16:06:46.300456728 -0700
@@ -14,9 +14,8 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/timer.h>
-#include <asm/hardirq.h>
+#include <linux/firmware.h>
 
-#include "linux/firmware.h"
 
 MODULE_AUTHOR("Manuel Estrada Sainz <ranty@debian.org>");
 MODULE_DESCRIPTION("Hackish sample for using firmware class directly");
diff -puN drivers/base/firmware_class.c~factor-out-common-asm-hardirqh-code drivers/base/firmware_class.c
--- 25/drivers/base/firmware_class.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.234466760 -0700
+++ 25-akpm/drivers/base/firmware_class.c	2004-09-02 16:06:46.336451256 -0700
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/timer.h>
 #include <linux/vmalloc.h>
-#include <asm/hardirq.h>
+#include <linux/interrupt.h>
 #include <linux/bitops.h>
 #include <asm/semaphore.h>
 
diff -puN drivers/char/rio/linux_compat.h~factor-out-common-asm-hardirqh-code drivers/char/rio/linux_compat.h
--- 25/drivers/char/rio/linux_compat.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.235466608 -0700
+++ 25-akpm/drivers/char/rio/linux_compat.h	2004-09-02 16:06:46.337451104 -0700
@@ -16,7 +16,7 @@
  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <asm/hardirq.h>
+#include <linux/interrupt.h>
 
 
 #define disable(oldspl) save_flags (oldspl)
diff -puN drivers/macintosh/via-pmu.c~factor-out-common-asm-hardirqh-code drivers/macintosh/via-pmu.c
--- 25/drivers/macintosh/via-pmu.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.237466304 -0700
+++ 25-akpm/drivers/macintosh/via-pmu.c	2004-09-02 16:06:46.339450800 -0700
@@ -52,7 +52,6 @@
 #include <asm/system.h>
 #include <asm/sections.h>
 #include <asm/irq.h>
-#include <asm/hardirq.h>
 #include <asm/pmac_feature.h>
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
diff -puN drivers/s390/cio/cio.c~factor-out-common-asm-hardirqh-code drivers/s390/cio/cio.c
--- 25/drivers/s390/cio/cio.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.239466000 -0700
+++ 25-akpm/drivers/s390/cio/cio.c	2004-09-02 16:06:46.340450648 -0700
@@ -17,8 +17,8 @@
 #include <linux/slab.h>
 #include <linux/device.h>
 #include <linux/kernel_stat.h>
+#include <linux/interrupt.h>
 
-#include <asm/hardirq.h>
 #include <asm/cio.h>
 #include <asm/delay.h>
 #include <asm/irq.h>
diff -puN include/asm-alpha/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-alpha/hardirq.h
--- 25/include/asm-alpha/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.240465848 -0700
+++ 25-akpm/include/asm-alpha/hardirq.h	2004-09-02 16:06:46.340450648 -0700
@@ -39,20 +39,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially nestable IRQ sources in the system
@@ -64,28 +50,7 @@ typedef struct {
 #error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-
-#ifdef CONFIG_PREEMPT
-#define in_atomic()	(preempt_count() != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-#define in_atomic()	(preempt_count() != 0)
-#define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-# endif
 #define irq_exit()						\
 do {								\
 		preempt_count() -= IRQ_EXIT_OFFSET;		\
@@ -95,10 +60,4 @@ do {								\
 		preempt_enable_no_resched();			\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* _ALPHA_HARDIRQ_H */
diff -puN include/asm-arm26/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-arm26/hardirq.h
--- 25/include/asm-arm26/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.241465696 -0700
+++ 25-akpm/include/asm-arm26/hardirq.h	2004-09-02 16:06:46.341450496 -0700
@@ -32,20 +32,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK|SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have space
  * for potentially all IRQ sources in the system nesting
@@ -55,26 +41,8 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 
-#ifdef CONFIG_PREEMPT
-# define in_atomic()    ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()    (preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #ifndef CONFIG_SMP
 #define irq_exit()							\
 	do {								\
@@ -84,9 +52,6 @@ typedef struct {
 		preempt_enable_no_resched();				\
 	} while (0)
 
-#define synchronize_irq(irq)	barrier()
-#else
-#error SMP not supported
 #endif
 
 #endif /* __ASM_HARDIRQ_H */
diff -puN include/asm-arm/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-arm/hardirq.h
--- 25/include/asm-arm/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.242465544 -0700
+++ 25-akpm/include/asm-arm/hardirq.h	2004-09-02 16:06:46.341450496 -0700
@@ -41,20 +41,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK|SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have space
  * for potentially all IRQ sources in the system nesting
@@ -64,29 +50,9 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #ifndef CONFIG_SMP
-
 extern asmlinkage void __do_softirq(void);
 
 #define irq_exit()							\
@@ -96,10 +62,6 @@ extern asmlinkage void __do_softirq(void
 			__do_softirq();					\
 		preempt_enable_no_resched();				\
 	} while (0)
-
-#define synchronize_irq(irq)	barrier()
-#else
-extern void synchronize_irq(unsigned int irq);
 #endif
 
 #endif /* __ASM_HARDIRQ_H */
diff -puN include/asm-cris/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-cris/hardirq.h
--- 25/include/asm-cris/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.244465240 -0700
+++ 25-akpm/include/asm-cris/hardirq.h	2004-09-02 16:06:46.342450344 -0700
@@ -40,20 +40,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -63,27 +49,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -92,6 +58,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#define synchronize_irq(irq)	barrier()
-
 #endif /* __ASM_HARDIRQ_H */
diff -puN include/asm-generic/local.h~factor-out-common-asm-hardirqh-code include/asm-generic/local.h
--- 25/include/asm-generic/local.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.245465088 -0700
+++ 25-akpm/include/asm-generic/local.h	2004-09-02 16:06:46.342450344 -0700
@@ -3,8 +3,8 @@
 
 #include <linux/config.h>
 #include <linux/percpu.h>
+#include <linux/hardirq.h>
 #include <asm/types.h>
-#include <asm/hardirq.h>
 
 /* An unsigned long type for operations which are atomic for a single
  * CPU.  Usually used in combination with per-cpu variables. */
diff -puN include/asm-h8300/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-h8300/hardirq.h
--- 25/include/asm-h8300/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.246464936 -0700
+++ 25-akpm/include/asm-h8300/hardirq.h	2004-09-02 16:06:46.343450192 -0700
@@ -38,20 +38,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -61,27 +47,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -90,10 +56,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-# error h8300 SMP is not available
-#endif /* CONFIG_SMP */
-
 #endif
diff -puN include/asm-i386/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-i386/hardirq.h
--- 25/include/asm-i386/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.248464632 -0700
+++ 25-akpm/include/asm-i386/hardirq.h	2004-09-02 16:06:46.343450192 -0700
@@ -37,20 +37,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -60,30 +46,10 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
-#define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 #define nmi_enter()		(irq_enter())
 #define nmi_exit()		(preempt_count() -= HARDIRQ_OFFSET)
 
-#ifdef CONFIG_PREEMPT
-# include <linux/smp_lock.h>
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
+#define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -92,10 +58,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* __ASM_HARDIRQ_H */
diff -puN include/asm-ia64/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-ia64/hardirq.h
--- 25/include/asm-ia64/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.249464480 -0700
+++ 25-akpm/include/asm-ia64/hardirq.h	2004-09-02 16:06:46.344450040 -0700
@@ -52,20 +52,6 @@
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have space for potentially all IRQ sources
  * in the system nesting on a single CPU:
@@ -74,31 +60,4 @@
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context?
- * Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
-#ifdef CONFIG_PREEMPT
-# include <linux/smp_lock.h>
-# define in_atomic()		((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()		(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
-#ifdef CONFIG_SMP
-  extern void synchronize_irq (unsigned int irq);
-#else
-# define synchronize_irq(irq)	barrier()
-#endif /* CONFIG_SMP */
-
 #endif /* _ASM_IA64_HARDIRQ_H */
diff -puN include/asm-m68k/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-m68k/hardirq.h
--- 25/include/asm-m68k/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.250464328 -0700
+++ 25-akpm/include/asm-m68k/hardirq.h	2004-09-02 16:06:46.344450040 -0700
@@ -35,20 +35,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -58,27 +44,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	(preempt_count() != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -87,6 +53,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#define synchronize_irq(irq)	barrier()
-
 #endif
diff -puN include/asm-m68knommu/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-m68knommu/hardirq.h
--- 25/include/asm-m68knommu/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.252464024 -0700
+++ 25-akpm/include/asm-m68knommu/hardirq.h	2004-09-02 16:06:46.345449888 -0700
@@ -36,20 +36,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -59,33 +45,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	(preempt_count() != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -94,10 +54,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-# error m68knommu SMP is not available
-#endif /* CONFIG_SMP */
-
 #endif /* __M68K_HARDIRQ_H */
diff -puN include/asm-m68k/system.h~factor-out-common-asm-hardirqh-code include/asm-m68k/system.h
--- 25/include/asm-m68k/system.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.253463872 -0700
+++ 25-akpm/include/asm-m68k/system.h	2004-09-02 16:06:46.345449888 -0700
@@ -51,7 +51,7 @@ asmlinkage void resume(void);
 #if 0
 #define local_irq_enable() asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory")
 #else
-#include <asm/hardirq.h>
+#include <linux/hardirq.h>
 #define local_irq_enable() ({							\
 	if (MACH_IS_Q40 || !hardirq_count())					\
 		asm volatile ("andiw %0,%%sr": : "i" (ALLOWINT) : "memory");	\
diff -puN include/asm-mips/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-mips/hardirq.h
--- 25/include/asm-mips/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.254463720 -0700
+++ 25-akpm/include/asm-mips/hardirq.h	2004-09-02 16:06:46.346449736 -0700
@@ -43,20 +43,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -66,27 +52,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# include <linux/smp_lock.h>
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
 #define irq_exit()                                                     \
 do {                                                                   \
 	preempt_count() -= IRQ_EXIT_OFFSET;                     \
@@ -95,10 +61,4 @@ do {                                    
 	preempt_enable_no_resched();                            \
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* _ASM_HARDIRQ_H */
diff -puN include/asm-parisc/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-parisc/hardirq.h
--- 25/include/asm-parisc/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.255463568 -0700
+++ 25-akpm/include/asm-parisc/hardirq.h	2004-09-02 16:06:46.346449736 -0700
@@ -51,20 +51,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have space for potentially all IRQ sources
  * in the system nesting on a single CPU:
@@ -73,29 +59,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context?
- * Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# error CONFIG_PREEMT currently not supported.
-# define in_atomic()	 BUG()
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #define irq_exit()								\
 do {										\
 		preempt_count() -= IRQ_EXIT_OFFSET;				\
@@ -104,10 +68,4 @@ do {										\
 		preempt_enable_no_resched();					\
 } while (0)
 
-#ifdef CONFIG_SMP
-  extern void synchronize_irq (unsigned int irq);
-#else
-# define synchronize_irq(irq)	barrier()
-#endif /* CONFIG_SMP */
-
 #endif /* _PARISC_HARDIRQ_H */
diff -puN include/asm-ppc64/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-ppc64/hardirq.h
--- 25/include/asm-ppc64/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.257463264 -0700
+++ 25-akpm/include/asm-ppc64/hardirq.h	2004-09-02 16:06:46.348449432 -0700
@@ -1,4 +1,3 @@
-#ifdef __KERNEL__
 #ifndef __ASM_HARDIRQ_H
 #define __ASM_HARDIRQ_H
 
@@ -43,20 +42,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __HARDIRQ_MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__HARDIRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define SOFTIRQ_MASK	(__HARDIRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-#define HARDIRQ_MASK	(__HARDIRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -66,29 +51,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define preemptible()	(preempt_count() == 0 && !irqs_disabled())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define preemptible()	0
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -97,12 +60,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
-#endif /* __KERNEL__ */
-	
 #endif /* __ASM_HARDIRQ_H */
diff -puN include/asm-ppc/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-ppc/hardirq.h
--- 25/include/asm-ppc/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.258463112 -0700
+++ 25-akpm/include/asm-ppc/hardirq.h	2004-09-02 16:06:46.347449584 -0700
@@ -44,20 +44,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -67,31 +53,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define preemptible()	(preempt_count() == 0 && !irqs_disabled())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define preemptible()	0
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #define irq_exit()							\
 do {									\
 	preempt_count() -= IRQ_EXIT_OFFSET;				\
@@ -100,11 +62,5 @@ do {									\
 	preempt_enable_no_resched();					\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* __ASM_HARDIRQ_H */
 #endif /* __KERNEL__ */
diff -puN include/asm-s390/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-s390/hardirq.h
--- 25/include/asm-s390/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.259462960 -0700
+++ 25-akpm/include/asm-s390/hardirq.h	2004-09-02 16:06:46.348449432 -0700
@@ -61,51 +61,15 @@ softirq_pending(unsigned int cpu)
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
+extern void do_call_softirq(void);
+extern void account_ticks(struct pt_regs *);
 
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
+#define invoke_softirq() do_call_softirq()
 
 #define irq_enter()							\
 do {									\
 	(preempt_count() += HARDIRQ_OFFSET);				\
 } while(0)
-	
-
-extern void do_call_softirq(void);
-extern void account_ticks(struct pt_regs *);
-
-#define invoke_softirq() do_call_softirq()
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #define irq_exit()							\
 do {									\
 	preempt_count() -= IRQ_EXIT_OFFSET;				\
diff -puN include/asm-s390/irq.h~factor-out-common-asm-hardirqh-code include/asm-s390/irq.h
--- 25/include/asm-s390/irq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.261462656 -0700
+++ 25-akpm/include/asm-s390/irq.h	2004-09-02 16:06:46.348449432 -0700
@@ -2,7 +2,7 @@
 #define _ASM_IRQ_H
 
 #ifdef __KERNEL__
-#include <asm/hardirq.h>
+#include <linux/hardirq.h>
 
 /*
  * the definition of irqs has changed in 2.5.46:
diff -puN include/asm-sh/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-sh/hardirq.h
--- 25/include/asm-sh/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.262462504 -0700
+++ 25-akpm/include/asm-sh/hardirq.h	2004-09-02 16:06:46.349449280 -0700
@@ -35,20 +35,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -58,29 +44,10 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we in an interrupt context? Either doing bottom half
- * or hardware interrupt processing?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
-#define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 #define nmi_enter()		(irq_enter())
 #define nmi_exit()		(preempt_count() -= HARDIRQ_OFFSET)
 
-#ifdef CONFIG_PREEMPT
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
+#define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -89,10 +56,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* __ASM_SH_HARDIRQ_H */
diff -puN include/asm-sparc64/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-sparc64/hardirq.h
--- 25/include/asm-sparc64/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.271461136 -0700
+++ 25-akpm/include/asm-sparc64/hardirq.h	2004-09-02 16:06:46.350449128 -0700
@@ -41,42 +41,7 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# include <linux/smp_lock.h>
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -85,10 +50,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* !(__SPARC64_HARDIRQ_H) */
diff -puN include/asm-sparc/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-sparc/hardirq.h
--- 25/include/asm-sparc/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.272460984 -0700
+++ 25-akpm/include/asm-sparc/hardirq.h	2004-09-02 16:06:46.349449280 -0700
@@ -42,42 +42,7 @@ typedef struct {
 #define SOFTIRQ_SHIFT   (PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT   (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)       ((1UL << (x))-1)
-
-#define PREEMPT_MASK    (__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK    (__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK    (__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
-#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
-#define irq_count()     (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET  (1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET  (1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET  (1UL << HARDIRQ_SHIFT)
-
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()                (hardirq_count())
-#define in_softirq()            (softirq_count())
-#define in_interrupt()          (irq_count())
-
-
-#define hardirq_trylock()       (!in_interrupt())
-#define hardirq_endlock()       do { } while (0)
-
 #define irq_enter()             (preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-#include <linux/smp_lock.h>
-# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()	(preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
 #define irq_exit()                                                      \
 do {                                                                    \
                 preempt_count() -= IRQ_EXIT_OFFSET;                     \
@@ -86,10 +51,4 @@ do {                                    
                 preempt_enable_no_resched();                            \
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else /* SMP */
-extern void synchronize_irq(unsigned int irq);
-#endif /* SMP */
-
 #endif /* __SPARC_HARDIRQ_H */
diff -puN include/asm-v850/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-v850/hardirq.h
--- 25/include/asm-v850/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.273460832 -0700
+++ 25-akpm/include/asm-v850/hardirq.h	2004-09-02 16:06:46.350449128 -0700
@@ -36,20 +36,6 @@ typedef struct {
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -59,27 +45,7 @@ typedef struct {
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
 #define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
-
-#ifdef CONFIG_PREEMPT
-# define in_atomic()    (preempt_count() != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()    (preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
-
 #define irq_exit()							      \
 do {									      \
 	preempt_count() -= IRQ_EXIT_OFFSET;				      \
@@ -88,10 +54,4 @@ do {									      \
 	preempt_enable_no_resched();					      \
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-# error v850nommu SMP is not available
-#endif /* CONFIG_SMP */
-
 #endif /* __V850_HARDIRQ_H__ */
diff -puN include/asm-x86_64/hardirq.h~factor-out-common-asm-hardirqh-code include/asm-x86_64/hardirq.h
--- 25/include/asm-x86_64/hardirq.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.275460528 -0700
+++ 25-akpm/include/asm-x86_64/hardirq.h	2004-09-02 16:06:46.351448976 -0700
@@ -37,20 +37,6 @@
 #define SOFTIRQ_SHIFT	(PREEMPT_SHIFT + PREEMPT_BITS)
 #define HARDIRQ_SHIFT	(SOFTIRQ_SHIFT + SOFTIRQ_BITS)
 
-#define __MASK(x)	((1UL << (x))-1)
-
-#define PREEMPT_MASK	(__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
-#define HARDIRQ_MASK	(__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
-#define SOFTIRQ_MASK	(__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
-
-#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
-#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
-#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
-
-#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
-#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
-#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
-
 /*
  * The hardirq mask has to be large enough to have
  * space for potentially all IRQ sources in the system
@@ -60,31 +46,10 @@
 # error HARDIRQ_BITS is too low!
 #endif
 
-/*
- * Are we doing bottom half or hardware interrupt processing?
- * Are we in a softirq context? Interrupt context?
- */
-#define in_irq()		(hardirq_count())
-#define in_softirq()		(softirq_count())
-#define in_interrupt()		(irq_count())
-
-
-#define hardirq_trylock()	(!in_interrupt())
-#define hardirq_endlock()	do { } while (0)
-
-#define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 #define nmi_enter()		(irq_enter())
 #define nmi_exit()		(preempt_count() -= HARDIRQ_OFFSET)
 
-
-#ifdef CONFIG_PREEMPT
-# include <linux/smp_lock.h>
-# define in_atomic()   ((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
-# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
-#else
-# define in_atomic()   (preempt_count() != 0)
-# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
-#endif
+#define irq_enter()		(preempt_count() += HARDIRQ_OFFSET)
 #define irq_exit()							\
 do {									\
 		preempt_count() -= IRQ_EXIT_OFFSET;			\
@@ -93,10 +58,4 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#ifndef CONFIG_SMP
-# define synchronize_irq(irq)	barrier()
-#else
-  extern void synchronize_irq(unsigned int irq);
-#endif /* CONFIG_SMP */
-
 #endif /* __ASM_HARDIRQ_H */
diff -puN /dev/null include/linux/hardirq.h
--- /dev/null	2003-09-15 06:40:47.000000000 -0700
+++ 25-akpm/include/linux/hardirq.h	2004-09-02 16:06:46.375445328 -0700
@@ -0,0 +1,51 @@
+#ifndef LINUX_HARDIRQ_H
+#define LINUX_HARDIRQ_H
+
+#include <linux/config.h>
+#ifdef CONFIG_PREEPT
+#include <linux/smp_lock.h>
+#endif
+#include <asm/hardirq.h>
+
+#define __IRQ_MASK(x)	((1UL << (x))-1)
+
+#define PREEMPT_MASK	(__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
+#define HARDIRQ_MASK	(__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
+#define SOFTIRQ_MASK	(__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
+
+#define PREEMPT_OFFSET	(1UL << PREEMPT_SHIFT)
+#define SOFTIRQ_OFFSET	(1UL << SOFTIRQ_SHIFT)
+#define HARDIRQ_OFFSET	(1UL << HARDIRQ_SHIFT)
+
+#define hardirq_count()	(preempt_count() & HARDIRQ_MASK)
+#define softirq_count()	(preempt_count() & SOFTIRQ_MASK)
+#define irq_count()	(preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
+
+/*
+ * Are we doing bottom half or hardware interrupt processing?
+ * Are we in a softirq context? Interrupt context?
+ */
+#define in_irq()		(hardirq_count())
+#define in_softirq()		(softirq_count())
+#define in_interrupt()		(irq_count())
+
+#define hardirq_trylock()	(!in_interrupt())
+#define hardirq_endlock()	do { } while (0)
+
+#ifdef CONFIG_PREEMPT
+# define in_atomic()	((preempt_count() & ~PREEMPT_ACTIVE) != kernel_locked())
+# define preemptible()	(preempt_count() == 0 && !irqs_disabled())
+# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
+#else
+# define in_atomic()	(preempt_count() != 0)
+# define preemptible()	0
+# define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
+#endif
+
+#ifdef CONFIG_SMP
+extern void synchronize_irq(unsigned int irq);
+#else
+# define synchronize_irq(irq)	barrier()
+#endif
+
+#endif /* LINUX_HARDIRQ_H */
diff -puN include/linux/interrupt.h~factor-out-common-asm-hardirqh-code include/linux/interrupt.h
--- 25/include/linux/interrupt.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.276460376 -0700
+++ 25-akpm/include/linux/interrupt.h	2004-09-02 16:06:46.351448976 -0700
@@ -8,8 +8,8 @@
 #include <linux/bitops.h>
 #include <linux/preempt.h>
 #include <linux/cpumask.h>
+#include <linux/hardirq.h>
 #include <asm/atomic.h>
-#include <asm/hardirq.h>
 #include <asm/ptrace.h>
 #include <asm/system.h>
 
diff -puN include/net/ipv6.h~factor-out-common-asm-hardirqh-code include/net/ipv6.h
--- 25/include/net/ipv6.h~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.278460072 -0700
+++ 25-akpm/include/net/ipv6.h	2004-09-02 16:06:46.352448824 -0700
@@ -16,7 +16,7 @@
 #define _NET_IPV6_H
 
 #include <linux/ipv6.h>
-#include <asm/hardirq.h>
+#include <linux/hardirq.h>
 #include <net/ndisc.h>
 #include <net/flow.h>
 #include <net/snmp.h>
diff -puN sound/oss/ali5455.c~factor-out-common-asm-hardirqh-code sound/oss/ali5455.c
--- 25/sound/oss/ali5455.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.279459920 -0700
+++ 25-akpm/sound/oss/ali5455.c	2004-09-02 16:06:46.354448520 -0700
@@ -65,7 +65,6 @@
 #include <linux/ac97_codec.h>
 #include <linux/interrupt.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 
 #ifndef PCI_DEVICE_ID_ALI_5455
 #define PCI_DEVICE_ID_ALI_5455	0x5455
diff -puN sound/oss/au1000.c~factor-out-common-asm-hardirqh-code sound/oss/au1000.c
--- 25/sound/oss/au1000.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.281459616 -0700
+++ 25-akpm/sound/oss/au1000.c	2004-09-02 16:06:46.356448216 -0700
@@ -67,9 +67,9 @@
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
 #include <linux/wrapper.h>
+#include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/au1000.h>
 #include <asm/au1000_dma.h>
 
diff -puN sound/oss/cs46xx.c~factor-out-common-asm-hardirqh-code sound/oss/cs46xx.c
--- 25/sound/oss/cs46xx.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.283459312 -0700
+++ 25-akpm/sound/oss/cs46xx.c	2004-09-02 16:06:46.360447608 -0700
@@ -94,7 +94,6 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 
 #include "cs46xxpm-24.h"
 #include "cs46xx_wrapper-24.h"
diff -puN sound/oss/forte.c~factor-out-common-asm-hardirqh-code sound/oss/forte.c
--- 25/sound/oss/forte.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.285459008 -0700
+++ 25-akpm/sound/oss/forte.c	2004-09-02 16:06:46.362447304 -0700
@@ -45,7 +45,6 @@
 #include <linux/proc_fs.h>
 
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/io.h>
 
 #define DRIVER_NAME	"forte"
diff -puN sound/oss/i810_audio.c~factor-out-common-asm-hardirqh-code sound/oss/i810_audio.c
--- 25/sound/oss/i810_audio.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.287458704 -0700
+++ 25-akpm/sound/oss/i810_audio.c	2004-09-02 16:06:46.364447000 -0700
@@ -101,7 +101,6 @@
 #include <linux/ac97_codec.h>
 #include <linux/bitops.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 
 #define DRIVER_VERSION "1.01"
 
diff -puN sound/oss/ite8172.c~factor-out-common-asm-hardirqh-code sound/oss/ite8172.c
--- 25/sound/oss/ite8172.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.289458400 -0700
+++ 25-akpm/sound/oss/ite8172.c	2004-09-02 16:06:46.366446696 -0700
@@ -70,10 +70,10 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/ac97_codec.h>
+#include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/it8172/it8172.h>
 
 /* --------------------------------------------------------------------- */
diff -puN sound/oss/nec_vrc5477.c~factor-out-common-asm-hardirqh-code sound/oss/nec_vrc5477.c
--- 25/sound/oss/nec_vrc5477.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.290458248 -0700
+++ 25-akpm/sound/oss/nec_vrc5477.c	2004-09-02 16:06:46.367446544 -0700
@@ -82,7 +82,6 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 
 /* -------------------debug macros -------------------------------------- */
 /* #undef VRC5477_AC97_DEBUG */
diff -puN sound/oss/rme96xx.c~factor-out-common-asm-hardirqh-code sound/oss/rme96xx.c
--- 25/sound/oss/rme96xx.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.292457944 -0700
+++ 25-akpm/sound/oss/rme96xx.c	2004-09-02 16:06:46.369446240 -0700
@@ -54,7 +54,7 @@ TODO:
 #include <linux/smp_lock.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <asm/hardirq.h>
+#include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/poll.h>
diff -puN sound/oss/swarm_cs4297a.c~factor-out-common-asm-hardirqh-code sound/oss/swarm_cs4297a.c
--- 25/sound/oss/swarm_cs4297a.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.294457640 -0700
+++ 25-akpm/sound/oss/swarm_cs4297a.c	2004-09-02 16:06:46.371445936 -0700
@@ -70,6 +70,7 @@
 #include <linux/ac97_codec.h>
 #include <linux/pci.h>
 #include <linux/bitops.h>
+#include <linux/interrupt.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <linux/init.h>
@@ -77,7 +78,6 @@
 #include <linux/smp_lock.h>
 #include <linux/wrapper.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 
 #include <asm/sibyte/sb1250_regs.h>
 #include <asm/sibyte/sb1250_int.h>
diff -puN sound/oss/trident.c~factor-out-common-asm-hardirqh-code sound/oss/trident.c
--- 25/sound/oss/trident.c~factor-out-common-asm-hardirqh-code	2004-09-02 16:06:46.295457488 -0700
+++ 25-akpm/sound/oss/trident.c	2004-09-02 16:06:46.374445480 -0700
@@ -217,7 +217,6 @@
 #include <linux/gameport.h>
 #include <linux/kernel.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 
_