Jeff Garzik <jeff@xxxxxxxxxx> writes:
commit 008b5fcf3c1d8456005de26ddd4256b1369225e8
Author: Jeff Garzik <jeff@xxxxxxxxxx>
Date: Fri Oct 19 00:45:51 2007 -0400
[IRQ ARG REMOVAL] core interrupt delivery infrastructure updates
include/asm-generic/irq_regs.h | 25 +++++++++++++++++++++++++
include/linux/interrupt.h | 4 ++--
kernel/irq/handle.c | 5 +++--
kernel/irq/manage.c | 4 ++--
kernel/irq/spurious.c | 3 ++-
lib/irq_regs.c | 5 +++++
6 files changed, 39 insertions(+), 7 deletions(-)
008b5fcf3c1d8456005de26ddd4256b1369225e8
diff --git a/include/asm-generic/irq_regs.h b/include/asm-generic/irq_regs.h
index 5ae1d07..1d99ef4 100644
--- a/include/asm-generic/irq_regs.h
+++ b/include/asm-generic/irq_regs.h
@@ -34,4 +34,29 @@ static inline struct pt_regs *set_irq_regs(struct pt_regs
*new_regs)
return old_regs;
}
+DECLARE_PER_CPU(unsigned int, __irqfunc_irqs);
+
+static inline unsigned int get_irqfunc_irq(void)
+{
+ return __get_cpu_var(__irqfunc_irqs);
+}
+
+#if 0
+static inline unsigned int set_irqfunc_irq(unsigned int new_irq)
+{
+ unsigned int old_irq, *pirq = &__get_cpu_var(__irqfunc_irqs);
+
+ old_irq = *pirq;
+ *pirq = new_irq;
+ return old_irq;
+}
+#else
+static inline void set_irqfunc_irq(unsigned int new_irq)
+{
+ int *pirq = &__get_cpu_var(__irqfunc_irqs);
+
+ *pirq = new_irq;
+}
+#endif
Please look at handle_IRQ_event. Local irqs are enabled so irq
recursion can happen. So not handling old_irq is a big nasty
bug.