Patch for faster interrupt handling.

Andi Kleen (ak@muc.de)
Tue, 4 Aug 1998 04:47:35 +0200


Hallo Linus,

This patch makes gcc generate better code in do_8254A_IRQ for the
UniProcessor case. The problem is that gcc generates horrible for
long long on i386, and cached_irq_mask was a long long. It only needs
to be 64bits to handle all the 64 IO-APIC IRQs, but on UP which supports
16 8254A interrupts only that is clearly not needed.

Please add this patch to the next 2.1 kernel.

Thanks,

-Andi

Index: linux/arch/i386/kernel/irq.c
===================================================================
RCS file: /vger/u4/cvs/linux/arch/i386/kernel/irq.c,v
retrieving revision 1.52
diff -u -r1.52 irq.c
--- irq.c 1998/07/26 03:01:27 1.52
+++ irq.c 1998/08/04 00:47:08
@@ -62,9 +62,9 @@
* (0x0000ffff for NR_IRQS==16, 0x00ffffff for NR_IRQS=24)
*/
#if NR_IRQS == 64
-unsigned long long cached_irq_mask = -1;
+irqmask_t cached_irq_mask = -1;
#else
-unsigned long long cached_irq_mask = (((unsigned long long) 1)<<NR_IRQS)-1;
+irqmask_t cached_irq_mask = (((irqmask_t) 1)<<NR_IRQS)-1;
#endif

#define cached_21 ((cached_irq_mask | io_apic_irqs) & 0xff)
@@ -88,7 +88,7 @@
* To get IO-APIC interrupts we turn some of them into IO-APIC
* interrupts during boot.
*/
-unsigned long long io_apic_irqs = 0;
+irqmask_t io_apic_irqs = 0;

static void do_8259A_IRQ (unsigned int irq, int cpu, struct pt_regs * regs);
static void enable_8259A_irq (unsigned int irq);
Index: linux/arch/i386/kernel/irq.h
===================================================================
RCS file: /vger/u4/cvs/linux/arch/i386/kernel/irq.h,v
retrieving revision 1.24
diff -u -r1.24 irq.h
--- irq.h 1998/08/03 20:03:16 1.24
+++ irq.h 1998/08/04 00:47:08
@@ -72,8 +72,14 @@
void init_pic_mode (void);
void print_IO_APIC (void);

-extern unsigned long long io_apic_irqs;
-extern unsigned long long cached_irq_mask;
+#ifdef __SMP__
+typedef unsigned long long irqmask_t; /* support upto 64 IOAPIC irqs */
+#else
+typedef unsigned long irqmask_t; /* Generate more efficient code */
+#endif
+
+extern irqmask_t io_apic_irqs;
+extern irqmask_t cached_irq_mask;

#define IO_APIC_VECTOR(irq) irq_vector[irq]


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html