Skip to contentSkip to conversation

irq handling code consolidation, second try (i386 part)

RFC New Andrey Panin 1 participant 1 message Jan 4, 2003

lore
Share & tools
lore
#0 lore raw

RFC 1/1 irq handling code consolidation, second try (i386 part)

Hi all,

attached patch is a second try of IRQ handling code consolidation. This is a i386 specific patch (tested and works).

Best regards.

Signature · 2 lines
Andrey Panin		| Embedded systems software developer
[email protected]	| PGP key: wwwkeys.pgp.net
arch/i386/Kconfig +4 -0
diff --minimal -urN -X /usr/share/dontdiff linux-2.5.53.vanilla/arch/i386/Kconfig linux-2.5.53/arch/i386/Kconfig
@@ -22,6 +22,10 @@
 	bool
 	default y
 
+config GENERIC_IRQ
+	bool
+	default y
+
 config SBUS
 	bool
 
arch/i386/kernel/irq.c +2 -609

643 lines not on this page · raw message

include/asm-i386/hw_irq.h +29 -0
diff --minimal -urN -X /usr/share/dontdiff linux-2.5.53.vanilla/include/asm-i386/hw_irq.h linux-2.5.53/include/asm-i386/hw_irq.h
@@ -140,4 +140,33 @@
 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
 #endif
 
+extern irq_desc_t irq_desc[NR_IRQS];
+
+/*
+ * Currently unexpected vectors happen only on SMP and APIC.
+ * We _must_ ack these because every local APIC has only N
+ * irq slots per priority level, and a 'hanging, unacked' IRQ
+ * holds up an irq slot - in excessive cases (when multiple
+ * unexpected vectors occur) that might lock up the APIC
+ * completely.
+ */
+#ifdef CONFIG_X86_LOCAL_APIC
+#define arch_ack_bad_irq(irq) ack_APIC_irq()
+#else
+#define arch_ack_bad_irq(irq) do { } while (0)
+#endif
+
+/* Return a pointer to the irq descriptor for IRQ.  */
+#define irq_desc(irq) (irq_desc + (irq))
+
+/* Check irq number */
+#define arch_check_irq(irq) ((irq) >= NR_IRQS)
+
+/* Arch specific hook for setup_irq() */
+#define arch_setup_irq(irq, desc, irqaction) do { } while (0)
+
+/* Used in setup_irq() */
+#define ARCH_NONSHARED_IRQ_MASK \
+	~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS)
+
 #endif /* _ASM_HW_IRQ_H */