summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-03-30 22:32:13 -0800
committerDavid S. Miller <davem@nuts.ninka.net>2003-03-30 22:32:13 -0800
commite328b98a082fe40696e744440469577b4b74e013 (patch)
tree1b20742074cd8354c62c358aa40b68dcf7078708
parent9e0206abf1d74a1001f3b4a912767d4072856cda (diff)
[SOFTIRQ]: Move softirq implementation to common area, add debug check.
1) Every arch implemented local_bh_foo identically, move to linux/interrupt.h 2) Kill all asm/softirq.h references 3) Kill asm/softirq.h itself 4) Move local_bh_disable() out of line to kernel/softirq.c 5) Add BUG check on irqs_disabled() to local_bh_disable()
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c1
-rw-r--r--arch/alpha/kernel/smp.c1
-rw-r--r--arch/ia64/sn/kernel/sv.c1
-rw-r--r--arch/m68k/kernel/m68k_ksyms.c1
-rw-r--r--arch/m68knommu/kernel/m68k_ksyms.c1
-rw-r--r--arch/mips/kernel/mips_ksyms.c1
-rw-r--r--arch/mips/kernel/smp.c1
-rw-r--r--arch/mips/mm/fault.c1
-rw-r--r--arch/mips64/kernel/mips64_ksyms.c1
-rw-r--r--arch/mips64/kernel/smp.c2
-rw-r--r--arch/mips64/mm/fault.c1
-rw-r--r--arch/ppc/kernel/smp.c1
-rw-r--r--arch/ppc/platforms/chrp_smp.c1
-rw-r--r--arch/ppc/platforms/pmac_smp.c1
-rw-r--r--arch/ppc64/kernel/smp.c1
-rw-r--r--arch/s390/kernel/s390_ksyms.c2
-rw-r--r--arch/s390x/kernel/s390_ksyms.c2
-rw-r--r--arch/sparc/kernel/irq.c1
-rw-r--r--arch/sparc/kernel/setup.c1
-rw-r--r--arch/sparc/kernel/smp.c1
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c1
-rw-r--r--arch/sparc/kernel/sun4d_smp.c1
-rw-r--r--arch/sparc/kernel/sun4m_smp.c1
-rw-r--r--arch/sparc64/kernel/irq.c1
-rw-r--r--arch/sparc64/kernel/smp.c1
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c1
-rw-r--r--arch/um/drivers/stdio_console.c1
-rw-r--r--arch/um/kernel/smp.c1
-rw-r--r--arch/v850/kernel/v850_ksyms.c1
-rw-r--r--crypto/internal.h2
-rw-r--r--include/asm-alpha/softirq.h21
-rw-r--r--include/asm-arm/hardirq.h1
-rw-r--r--include/asm-arm/softirq.h20
-rw-r--r--include/asm-cris/softirq.h30
-rw-r--r--include/asm-i386/hardirq.h1
-rw-r--r--include/asm-i386/softirq.h20
-rw-r--r--include/asm-ia64/softirq.h26
-rw-r--r--include/asm-m68k/softirq.h24
-rw-r--r--include/asm-m68knommu/softirq.h20
-rw-r--r--include/asm-mips/softirq.h45
-rw-r--r--include/asm-mips64/softirq.h57
-rw-r--r--include/asm-parisc/softirq.h20
-rw-r--r--include/asm-ppc/softirq.h31
-rw-r--r--include/asm-ppc64/softirq.h27
-rw-r--r--include/asm-s390/softirq.h42
-rw-r--r--include/asm-s390x/softirq.h42
-rw-r--r--include/asm-sh/softirq.h30
-rw-r--r--include/asm-sparc/softirq.h31
-rw-r--r--include/asm-sparc64/softirq.h25
-rw-r--r--include/asm-um/softirq.h13
-rw-r--r--include/asm-v850/softirq.h20
-rw-r--r--include/asm-x86_64/softirq.h22
-rw-r--r--include/linux/interrupt.h8
-rw-r--r--include/linux/mtd/compatmac.h1
-rw-r--r--kernel/softirq.c12
55 files changed, 23 insertions, 600 deletions
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index ee3db0c214ba..c9a1d55d0dbd 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -25,7 +25,6 @@
#include <asm/processor.h>
#include <asm/checksum.h>
#include <linux/interrupt.h>
-#include <asm/softirq.h>
#include <asm/fpu.h>
#include <asm/irq.h>
#include <asm/machvec.h>
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index 4cfc0a679a7d..b23cde1f1a99 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -35,7 +35,6 @@
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/mmu_context.h>
#include <asm/tlbflush.h>
diff --git a/arch/ia64/sn/kernel/sv.c b/arch/ia64/sn/kernel/sv.c
index 5bc910514e55..84bedef9f6e2 100644
--- a/arch/ia64/sn/kernel/sv.c
+++ b/arch/ia64/sn/kernel/sv.c
@@ -18,7 +18,6 @@
#include <asm/semaphore.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/current.h>
#include <asm/sn/sv.h>
diff --git a/arch/m68k/kernel/m68k_ksyms.c b/arch/m68k/kernel/m68k_ksyms.c
index 3a40bfc2438e..b069b0c843b3 100644
--- a/arch/m68k/kernel/m68k_ksyms.c
+++ b/arch/m68k/kernel/m68k_ksyms.c
@@ -17,7 +17,6 @@
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
asmlinkage long long __ashldi3 (long long, int);
asmlinkage long long __ashrdi3 (long long, int);
diff --git a/arch/m68knommu/kernel/m68k_ksyms.c b/arch/m68knommu/kernel/m68k_ksyms.c
index becd58cc9ea8..7700ca82af83 100644
--- a/arch/m68knommu/kernel/m68k_ksyms.c
+++ b/arch/m68knommu/kernel/m68k_ksyms.c
@@ -17,7 +17,6 @@
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/current.h>
extern void dump_thread(struct pt_regs *, struct user *);
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index 1ee7d3939ec8..3109b7485a8c 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -25,7 +25,6 @@
#include <asm/pgalloc.h>
#include <asm/semaphore.h>
#include <asm/sgi/sgihpc.h>
-#include <asm/softirq.h>
#include <asm/uaccess.h>
#ifdef CONFIG_BLK_DEV_FD
#include <asm/floppy.h>
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index f766ead50818..36e55ea4d57e 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -37,7 +37,6 @@
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/mmu_context.h>
#include <asm/delay.h>
#include <asm/smp.h>
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index 286d2648fad0..8e648749ec78 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -22,7 +22,6 @@
#include <asm/hardirq.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
-#include <asm/softirq.h>
#include <asm/system.h>
#include <asm/uaccess.h>
diff --git a/arch/mips64/kernel/mips64_ksyms.c b/arch/mips64/kernel/mips64_ksyms.c
index c18a50df3ada..230a5bf59304 100644
--- a/arch/mips64/kernel/mips64_ksyms.c
+++ b/arch/mips64/kernel/mips64_ksyms.c
@@ -24,7 +24,6 @@
#include <asm/page.h>
#include <asm/pgalloc.h>
#include <asm/semaphore.h>
-#include <asm/softirq.h>
#include <asm/uaccess.h>
#include <asm/checksum.h>
diff --git a/arch/mips64/kernel/smp.c b/arch/mips64/kernel/smp.c
index 9ccb54fa72b5..757e6e44fda6 100644
--- a/arch/mips64/kernel/smp.c
+++ b/arch/mips64/kernel/smp.c
@@ -6,12 +6,12 @@
#include <linux/timex.h>
#include <linux/sched.h>
#include <linux/cache.h>
+#include <linux/interrupt.h>
#include <asm/atomic.h>
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/mmu_context.h>
#include <asm/irq.h>
diff --git a/arch/mips64/mm/fault.c b/arch/mips64/mm/fault.c
index 68326e7362ad..ba3cc05a1106 100644
--- a/arch/mips64/mm/fault.c
+++ b/arch/mips64/mm/fault.c
@@ -24,7 +24,6 @@
#include <asm/hardirq.h>
#include <asm/pgalloc.h>
#include <asm/mmu_context.h>
-#include <asm/softirq.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/ptrace.h>
diff --git a/arch/ppc/kernel/smp.c b/arch/ppc/kernel/smp.c
index e5094573c5c0..21a23f743738 100644
--- a/arch/ppc/kernel/smp.c
+++ b/arch/ppc/kernel/smp.c
@@ -28,7 +28,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c
index cee354253e49..a776b83bf8da 100644
--- a/arch/ppc/platforms/chrp_smp.c
+++ b/arch/ppc/platforms/chrp_smp.c
@@ -27,7 +27,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/sections.h>
#include <asm/io.h>
#include <asm/prom.h>
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
index 6bbe4819de1a..f558e977e242 100644
--- a/arch/ppc/platforms/pmac_smp.c
+++ b/arch/ppc/platforms/pmac_smp.c
@@ -35,7 +35,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/sections.h>
#include <asm/io.h>
#include <asm/prom.h>
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c
index 44bd8bb70914..f52f6c9f5f9f 100644
--- a/arch/ppc64/kernel/smp.c
+++ b/arch/ppc64/kernel/smp.c
@@ -34,7 +34,6 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/smp.h>
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
index 00c4cf2f1210..0f4a0046a732 100644
--- a/arch/s390/kernel/s390_ksyms.c
+++ b/arch/s390/kernel/s390_ksyms.c
@@ -6,10 +6,10 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/smp.h>
+#include <linux/interrupt.h>
#include <asm/checksum.h>
#include <asm/delay.h>
#include <asm/setup.h>
-#include <asm/softirq.h>
#if CONFIG_IP_MULTICAST
#include <net/arp.h>
#endif
diff --git a/arch/s390x/kernel/s390_ksyms.c b/arch/s390x/kernel/s390_ksyms.c
index 20561a6fc9a1..d7b3fac0b5fc 100644
--- a/arch/s390x/kernel/s390_ksyms.c
+++ b/arch/s390x/kernel/s390_ksyms.c
@@ -8,11 +8,11 @@
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/smp.h>
+#include <linux/interrupt.h>
#include <asm/checksum.h>
#include <asm/delay.h>
#include <asm/pgalloc.h>
#include <asm/setup.h>
-#include <asm/softirq.h>
#if CONFIG_IP_MULTICAST
#include <net/arp.h>
#endif
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 311338e03644..ea9ce5c9861e 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -45,7 +45,6 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/pcic.h>
#include <asm/cacheflush.h>
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 24b37f81f518..48900efa83a2 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -43,7 +43,6 @@
#include <asm/kdebug.h>
#include <asm/mbus.h>
#include <asm/idprom.h>
-#include <asm/softirq.h>
#include <asm/hardirq.h>
#include <asm/machines.h>
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c
index b4ca31eecb20..73a2386bef49 100644
--- a/arch/sparc/kernel/smp.c
+++ b/arch/sparc/kernel/smp.c
@@ -30,7 +30,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index f31a846379e3..d67ca33754ee 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -40,7 +40,6 @@
#include <asm/smp.h>
#include <asm/mostek.h>
#include <asm/ptrace.h>
-#include <asm/softirq.h>
#include <asm/hardirq.h>
#include <asm/user.h>
#include <asm/uaccess.h>
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 0597e81b5109..9810917d2bff 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -29,7 +29,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/sbus.h>
#include <asm/sbi.h>
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 27f64763f7de..a0432f504bd3 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -26,7 +26,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 53f0cb708537..03b8432b779a 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -33,7 +33,6 @@
#include <asm/timer.h>
#include <asm/smp.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/starfire.h>
#include <asm/uaccess.h>
#include <asm/cache.h>
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 3745aec1b7dd..cf73f8df0f0d 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -31,7 +31,6 @@
#include <asm/pgtable.h>
#include <asm/oplib.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/uaccess.h>
#include <asm/timer.h>
#include <asm/starfire.h>
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index ca86ddcd90b9..f12121dbcf83 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -30,7 +30,6 @@
#include <asm/pgtable.h>
#include <asm/io.h>
#include <asm/irq.h>
-#include <asm/softirq.h>
#include <asm/hardirq.h>
#include <asm/idprom.h>
#include <asm/svr4.h>
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index e161b413f677..4aaec540e505 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -18,7 +18,6 @@
#include "linux/interrupt.h"
#include "linux/slab.h"
#include "asm/current.h"
-#include "asm/softirq.h"
#include "asm/hardirq.h"
#include "asm/irq.h"
#include "stdio_console.h"
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index adc58d1b34de..227580b4bc50 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -17,7 +17,6 @@ unsigned long cpu_online_map = 1;
#include "asm/smp.h"
#include "asm/processor.h"
#include "asm/spinlock.h"
-#include "asm/softirq.h"
#include "asm/hardirq.h"
#include "user_util.h"
#include "kern_util.h"
diff --git a/arch/v850/kernel/v850_ksyms.c b/arch/v850/kernel/v850_ksyms.c
index 86b866358b9b..74bf9ace4c7e 100644
--- a/arch/v850/kernel/v850_ksyms.c
+++ b/arch/v850/kernel/v850_ksyms.c
@@ -16,7 +16,6 @@
#include <asm/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/current.h>
diff --git a/crypto/internal.h b/crypto/internal.h
index b67c0ee8fe54..10880d149afe 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -13,9 +13,9 @@
#define _CRYPTO_INTERNAL_H
#include <linux/mm.h>
#include <linux/highmem.h>
+#include <linux/interrupt.h>
#include <linux/init.h>
#include <asm/hardirq.h>
-#include <asm/softirq.h>
#include <asm/kmap_types.h>
extern enum km_type crypto_km_types[];
diff --git a/include/asm-alpha/softirq.h b/include/asm-alpha/softirq.h
deleted file mode 100644
index 401ea9e1b76e..000000000000
--- a/include/asm-alpha/softirq.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _ALPHA_SOFTIRQ_H
-#define _ALPHA_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && \
- softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* _ALPHA_SOFTIRQ_H */
diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h
index 3f164e01f7a1..df9f03a8dcf1 100644
--- a/include/asm-arm/hardirq.h
+++ b/include/asm-arm/hardirq.h
@@ -5,7 +5,6 @@
#include <linux/cache.h>
#include <linux/threads.h>
-/* softirq.h is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_pending;
unsigned int __local_irq_count;
diff --git a/include/asm-arm/softirq.h b/include/asm-arm/softirq.h
deleted file mode 100644
index 3dfcdb13ecaf..000000000000
--- a/include/asm-arm/softirq.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- __asm__("bl%? __do_softirq": : : "lr");/* out of line */\
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-cris/softirq.h b/include/asm-cris/softirq.h
deleted file mode 100644
index c5b2d8873f9a..000000000000
--- a/include/asm-cris/softirq.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
-do { \
- local_bh_count(smp_processor_id())++; \
- barrier(); \
-} while (0)
-
-#define __local_bh_enable() \
-do { \
- barrier(); \
- local_bh_count(smp_processor_id())--; \
-} while (0)
-
-#define local_bh_enable() \
-do { \
- if (!--local_bh_count(smp_processor_id()) \
- && softirq_pending(smp_processor_id())) { \
- do_softirq(); \
- local_irq_enable(); \
- } \
-} while (0)
-
-#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h
index 6dfd2ceebf3a..e8b9149f0b29 100644
--- a/include/asm-i386/hardirq.h
+++ b/include/asm-i386/hardirq.h
@@ -5,7 +5,6 @@
#include <linux/threads.h>
#include <linux/irq.h>
-/* assembly code in softirq.h is sensitive to the offsets of these fields */
typedef struct {
unsigned int __softirq_pending;
unsigned int __syscall_count;
diff --git a/include/asm-i386/softirq.h b/include/asm-i386/softirq.h
deleted file mode 100644
index d944be956a25..000000000000
--- a/include/asm-i386/softirq.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-ia64/softirq.h b/include/asm-ia64/softirq.h
deleted file mode 100644
index a50f2d240aac..000000000000
--- a/include/asm-ia64/softirq.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _ASM_IA64_SOFTIRQ_H
-#define _ASM_IA64_SOFTIRQ_H
-
-#include <linux/compiler.h>
-
-/*
- * Copyright (C) 1998-2002 Hewlett-Packard Co
- * David Mosberger-Tang <davidm@hpl.hp.com>
- */
-#include <linux/compiler.h>
-#include <linux/preempt.h>
-
-#include <asm/hardirq.h>
-
-#define __local_bh_enable() do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_disable() do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && local_softirq_pending())) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* _ASM_IA64_SOFTIRQ_H */
diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h
deleted file mode 100644
index 0c2f0e2044c6..000000000000
--- a/include/asm-m68k/softirq.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef __M68K_SOFTIRQ_H
-#define __M68K_SOFTIRQ_H
-
-/*
- * Software interrupts.. no SMP here either.
- */
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif
diff --git a/include/asm-m68knommu/softirq.h b/include/asm-m68knommu/softirq.h
deleted file mode 100644
index d944be956a25..000000000000
--- a/include/asm-m68knommu/softirq.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-mips/softirq.h b/include/asm-mips/softirq.h
deleted file mode 100644
index 646202705c17..000000000000
--- a/include/asm-mips/softirq.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1997, 1998, 1999, 2000, 2001 Ralf Baechle
- * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
- * Copyright (C) 1999, 2001 MIPS Technologies, Inc.
- */
-#ifndef _ASM_SOFTIRQ_H
-#define _ASM_SOFTIRQ_H
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-
-extern inline void cpu_bh_disable(int cpu)
-{
- local_bh_count(cpu)++;
- barrier();
-}
-
-extern inline void __cpu_bh_enable(int cpu)
-{
- barrier();
- local_bh_count(cpu)--;
-}
-
-
-#define local_bh_disable() cpu_bh_disable(smp_processor_id())
-#define __local_bh_enable() __cpu_bh_enable(smp_processor_id())
-#define local_bh_enable() \
-do { \
- int cpu; \
- \
- barrier(); \
- cpu = smp_processor_id(); \
- if (!--local_bh_count(cpu) && softirq_pending(cpu)) \
- do_softirq(); \
-} while (0)
-
-#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
-
-#define __cpu_raise_softirq(cpu, nr) set_bit(nr, &softirq_pending(cpu))
-
-#endif /* _ASM_SOFTIRQ_H */
diff --git a/include/asm-mips64/softirq.h b/include/asm-mips64/softirq.h
deleted file mode 100644
index 9d070a7f2612..000000000000
--- a/include/asm-mips64/softirq.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1997, 1998, 1999, 2000, 2001 by Ralf Baechle
- * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
- * Copyright (C) 2001 MIPS Technologies, Inc.
- */
-#ifndef _ASM_SOFTIRQ_H
-#define _ASM_SOFTIRQ_H
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-
-extern inline void cpu_bh_disable(int cpu)
-{
- local_bh_count(cpu)++;
- barrier();
-}
-
-extern inline void __cpu_bh_enable(int cpu)
-{
- barrier();
- local_bh_count(cpu)--;
-}
-
-#define local_bh_disable() cpu_bh_disable(smp_processor_id())
-#define __local_bh_enable() __cpu_bh_enable(smp_processor_id())
-#define local_bh_enable() \
-do { \
- int cpu; \
- \
- barrier(); \
- cpu = smp_processor_id(); \
- if (!--local_bh_count(cpu) && softirq_pending(cpu)) \
- do_softirq(); \
-} while (0)
-
-#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
-
-extern inline void __cpu_raise_softirq(int cpu, int nr)
-{
- unsigned int *m = (unsigned int *) &softirq_pending(cpu);
- unsigned int temp;
-
- __asm__ __volatile__(
- "1:\tll\t%0, %1\t\t\t# __cpu_raise_softirq\n\t"
- "or\t%0, %2\n\t"
- "sc\t%0, %1\n\t"
- "beqz\t%0, 1b"
- : "=&r" (temp), "=m" (*m)
- : "ir" (1UL << nr), "m" (*m)
- : "memory");
-}
-
-#endif /* _ASM_SOFTIRQ_H */
diff --git a/include/asm-parisc/softirq.h b/include/asm-parisc/softirq.h
deleted file mode 100644
index 8bf7c1256ad7..000000000000
--- a/include/asm-parisc/softirq.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-ppc/softirq.h b/include/asm-ppc/softirq.h
deleted file mode 100644
index 79ccd5db8928..000000000000
--- a/include/asm-ppc/softirq.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifdef __KERNEL__
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
-do { \
- preempt_count() += SOFTIRQ_OFFSET; \
- barrier(); \
-} while (0)
-
-#define __local_bh_enable() \
-do { \
- barrier(); \
- preempt_count() -= SOFTIRQ_OFFSET; \
-} while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() \
- && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- if (preempt_count() == 0) \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc64/softirq.h b/include/asm-ppc64/softirq.h
deleted file mode 100644
index 33c076828553..000000000000
--- a/include/asm-ppc64/softirq.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/asm-s390/softirq.h b/include/asm-s390/softirq.h
deleted file mode 100644
index 91f9853561dd..000000000000
--- a/include/asm-s390/softirq.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * include/asm-s390/softirq.h
- *
- * S390 version
- *
- * Derived from "include/asm-i386/softirq.h"
- */
-
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/smp.h>
-#include <linux/preempt.h>
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-#include <asm/lowcore.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-extern void do_call_softirq(void);
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (!in_interrupt() && softirq_pending(smp_processor_id())) \
- /* Use the async. stack for softirq */ \
- do_call_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
-
-
-
-
-
-
-
diff --git a/include/asm-s390x/softirq.h b/include/asm-s390x/softirq.h
deleted file mode 100644
index 91f9853561dd..000000000000
--- a/include/asm-s390x/softirq.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * include/asm-s390/softirq.h
- *
- * S390 version
- *
- * Derived from "include/asm-i386/softirq.h"
- */
-
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/smp.h>
-#include <linux/preempt.h>
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-#include <asm/lowcore.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-extern void do_call_softirq(void);
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (!in_interrupt() && softirq_pending(smp_processor_id())) \
- /* Use the async. stack for softirq */ \
- do_call_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
-
-
-
-
-
-
-
diff --git a/include/asm-sh/softirq.h b/include/asm-sh/softirq.h
deleted file mode 100644
index 1c4229e1b9e5..000000000000
--- a/include/asm-sh/softirq.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __ASM_SH_SOFTIRQ_H
-#define __ASM_SH_SOFTIRQ_H
-
-#include <asm/atomic.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
-do { \
- local_bh_count(smp_processor_id())++; \
- barrier(); \
-} while (0)
-
-#define __local_bh_enable() \
-do { \
- barrier(); \
- local_bh_count(smp_processor_id())--; \
-} while (0)
-
-#define local_bh_enable() \
-do { \
- barrier(); \
- if (!--local_bh_count(smp_processor_id()) \
- && softirq_pending(smp_processor_id())) { \
- do_softirq(); \
- } \
-} while (0)
-
-#define in_softirq() (local_bh_count(smp_processor_id()) != 0)
-
-#endif /* __ASM_SH_SOFTIRQ_H */
diff --git a/include/asm-sparc/softirq.h b/include/asm-sparc/softirq.h
deleted file mode 100644
index e9f7d10e97d0..000000000000
--- a/include/asm-sparc/softirq.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* softirq.h: 32-bit Sparc soft IRQ support.
- *
- * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1998-99 Anton Blanchard (anton@progsoc.uts.edu.au)
- */
-
-#ifndef __SPARC_SOFTIRQ_H
-#define __SPARC_SOFTIRQ_H
-
-// #include <linux/threads.h> /* For NR_CPUS */
-
-// #include <asm/atomic.h>
-#include <asm/smp.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (!in_interrupt() && \
- softirq_pending(smp_processor_id())) { \
- do_softirq(); \
- } \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __SPARC_SOFTIRQ_H */
diff --git a/include/asm-sparc64/softirq.h b/include/asm-sparc64/softirq.h
deleted file mode 100644
index 80e625e920f8..000000000000
--- a/include/asm-sparc64/softirq.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* softirq.h: 64-bit Sparc soft IRQ support.
- *
- * Copyright (C) 1997, 1998 David S. Miller (davem@caip.rutgers.edu)
- */
-
-#ifndef __SPARC64_SOFTIRQ_H
-#define __SPARC64_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-#include <asm/system.h> /* for membar() */
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-#define local_bh_enable() \
-do { __local_bh_enable(); \
- if (unlikely(!in_interrupt() && \
- softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* !(__SPARC64_SOFTIRQ_H) */
diff --git a/include/asm-um/softirq.h b/include/asm-um/softirq.h
deleted file mode 100644
index 41734a0a9602..000000000000
--- a/include/asm-um/softirq.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __UM_SOFTIRQ_H
-#define __UM_SOFTIRQ_H
-
-#include "linux/smp.h"
-#include "asm/system.h"
-#include "asm/processor.h"
-
-/* A gratuitous name change */
-#define i386_bh_lock um_bh_lock
-#include "asm/arch/softirq.h"
-#undef i386_bh_lock
-
-#endif
diff --git a/include/asm-v850/softirq.h b/include/asm-v850/softirq.h
deleted file mode 100644
index 6d514c7ab8da..000000000000
--- a/include/asm-v850/softirq.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __V850_SOFTIRQ_H__
-#define __V850_SOFTIRQ_H__
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __V850_SOFTIRQ_H__ */
diff --git a/include/asm-x86_64/softirq.h b/include/asm-x86_64/softirq.h
deleted file mode 100644
index 436bdc869980..000000000000
--- a/include/asm-x86_64/softirq.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef __ASM_SOFTIRQ_H
-#define __ASM_SOFTIRQ_H
-
-#include <linux/preempt.h>
-#include <asm/hardirq.h>
-
-#define local_bh_disable() \
- do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
-#define __local_bh_enable() \
- do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
-
-void do_softirq(void);
-
-#define local_bh_enable() \
-do { \
- __local_bh_enable(); \
- if (unlikely(!in_interrupt() && softirq_pending(smp_processor_id()))) \
- do_softirq(); \
- preempt_check_resched(); \
-} while (0)
-
-#endif /* __ASM_SOFTIRQ_H */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 7a0681b9e880..e71f89ae8b3f 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -8,7 +8,6 @@
#include <asm/atomic.h>
#include <asm/hardirq.h>
#include <asm/ptrace.h>
-#include <asm/softirq.h>
#include <asm/system.h>
struct irqaction {
@@ -36,6 +35,13 @@ extern void free_irq(unsigned int, void *);
# define save_and_cli(x) local_irq_save(x)
#endif
+/* SoftIRQ primitives. */
+#define local_bh_disable() \
+ do { preempt_count() += SOFTIRQ_OFFSET; barrier(); } while (0)
+#define __local_bh_enable() \
+ do { barrier(); preempt_count() -= SOFTIRQ_OFFSET; } while (0)
+
+extern void local_bh_enable(void);
/* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
frequency threaded job scheduling. For almost all the purposes
diff --git a/include/linux/mtd/compatmac.h b/include/linux/mtd/compatmac.h
index e5ddc3d408f8..19e6d2f849d5 100644
--- a/include/linux/mtd/compatmac.h
+++ b/include/linux/mtd/compatmac.h
@@ -194,7 +194,6 @@ static inline int try_inc_mod_count(struct module *mod)
#define spin_unlock_bh(lock) do {spin_unlock(lock);end_bh_atomic();} while(0)
#else
#include <linux/interrupt.h>
-#include <asm/softirq.h>
#include <linux/spinlock.h>
#endif
diff --git a/kernel/softirq.c b/kernel/softirq.c
index f9d76d9f06b6..77ee098739e1 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -6,6 +6,7 @@
* Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)
*/
+#include <linux/module.h>
#include <linux/kernel_stat.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
@@ -100,6 +101,17 @@ restart:
local_irq_restore(flags);
}
+void local_bh_enable(void)
+{
+ __local_bh_enable();
+ BUG_ON(irqs_disabled());
+ if (unlikely(!in_interrupt() &&
+ softirq_pending(smp_processor_id())))
+ do_softirq();
+ preempt_check_resched();
+}
+EXPORT_SYMBOL(local_bh_enable);
+
/*
* This function must run with irqs disabled!
*/