]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Allow more APIC irq sources
authorJames Cleverdon <jamesclv@us.ibm.com>
Tue, 21 Oct 2003 14:27:58 +0000 (07:27 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 21 Oct 2003 14:27:58 +0000 (07:27 -0700)
The "irq_vector[]" array is indexed by the sum of all RTEs in all I/O
APICs, and is not necessarily limited by the x86 CPU irq vector inputs.

In fact, the irq vector index would overflow on big machines with lots
of IO APIC's, causing the boot to fail.

So grow the array for the big SMP boxes, keeping the default the same as
before (and shrink the vector entry size down to a 8-bit value, since
that's the size of the actual CPU vector entry).

arch/i386/kernel/io_apic.c
include/asm-i386/hw_irq.h
include/asm-i386/mach-default/irq_vectors.h

index e9e656a63d75c02d6c5bf0d82cdae6cd830e1ecf..2907f82f69887bcc869ec18e19b4d7d33f11f1dd 100644 (file)
@@ -1138,12 +1138,13 @@ static inline int IO_APIC_irq_trigger(int irq)
        return 0;
 }
 
-int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 };
+/* irq_vectors is indexed by the sum of all RTEs in all I/O APICs. */
+u8 irq_vector[NR_IRQ_VECTORS] = { FIRST_DEVICE_VECTOR , 0 };
 
 static int __init assign_irq_vector(int irq)
 {
        static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
-       BUG_ON(irq >= NR_IRQS);
+       BUG_ON(irq >= NR_IRQ_VECTORS);
        if (IO_APIC_VECTOR(irq) > 0)
                return IO_APIC_VECTOR(irq);
 next:
index 0ed5a111d7ca33f81e5b93f59b5c0f55ce2952fe..225539187eb6098d9ace88974aef07257456973c 100644 (file)
@@ -25,8 +25,8 @@
  * Interrupt entry/exit code at both C and assembly level
  */
 
-extern int irq_vector[NR_IRQS];
-#define IO_APIC_VECTOR(irq)    irq_vector[irq]
+extern u8 irq_vector[NR_IRQ_VECTORS];
+#define IO_APIC_VECTOR(irq)    ((int)irq_vector[irq])
 
 extern void (*interrupt[NR_IRQS])(void);
 
index df6191450ed5cee7855a289f1e466ff99ae31d55..a0371dc3113732f89071782b64cee968dd52fd8e 100644 (file)
  */
 #ifdef CONFIG_X86_IO_APIC
 #define NR_IRQS 224
+# if (224 >= 32 * NR_CPUS)
+# define NR_IRQ_VECTORS NR_IRQS
+# else
+# define NR_IRQ_VECTORS (32 * NR_CPUS)
+# endif
 #else
 #define NR_IRQS 16
+#define NR_IRQ_VECTORS NR_IRQS
 #endif
 
 #define FPU_IRQ                        13