aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-01-04 05:26:18 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:26:18 -0800
commit67c69b53336d5e822e759a3590a77bb10bc97aa4 (patch)
tree1c69a74ff63a1420172dc82101c01ca34ff2c3f6 /kernel
parent08ccfcc14c06015f62144b309ceab92abf510bd6 (diff)
downloadhistory-67c69b53336d5e822e759a3590a77bb10bc97aa4.tar.gz
[PATCH] move irq_enter and irq_exit to common code
This code is the same for all architectures with the following invariants: - arm gurantees irqs are disabled when calling irq_exit so it can call __do_softirq directly instead of do_softirq - arm26 is totally broken for about half a year, I didn't care for it - some architectures use softirq_pending(smp_processor_id()) instead of local_softirq_pending, but they always evaluate to the same This patch moves the out of line irq_exit implementation from kernel/irq/handle.c which depends on CONFIG_GENERIC_HARDIRQS to kernel/softirq.c which is always compiled, tweaks it for the arm special case and moves the irq_enter/irq_exit/nmi_enter/nmi_exit bits from asm-*/hardirq.h to linux/hardirq.h Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/irq/handle.c11
-rw-r--r--kernel/softirq.c17
2 files changed, 17 insertions, 11 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index ebc25823b73da9..2fb0e46e11f390 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -73,17 +73,6 @@ irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs)
}
/*
- * Exit an interrupt context. Process softirqs if needed and possible:
- */
-void irq_exit(void)
-{
- preempt_count() -= IRQ_EXIT_OFFSET;
- if (!in_interrupt() && local_softirq_pending())
- do_softirq();
- preempt_enable_no_resched();
-}
-
-/*
* Have got an event to handle:
*/
fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 7572ca9ece74a4..8d6e9055e2b910 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -152,6 +152,23 @@ void local_bh_enable(void)
}
EXPORT_SYMBOL(local_bh_enable);
+#ifdef __ARCH_IRQ_EXIT_IRQS_DISABLED
+# define invoke_softirq() __do_softirq()
+#else
+# define invoke_softirq() do_softirq()
+#endif
+
+/*
+ * Exit an interrupt context. Process softirqs if needed and possible:
+ */
+void irq_exit(void)
+{
+ preempt_count() -= IRQ_EXIT_OFFSET;
+ if (!in_interrupt() && local_softirq_pending())
+ invoke_softirq();
+ preempt_enable_no_resched();
+}
+
/*
* This function must run with irqs disabled!
*/