]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86: use NR_IRQS_LEGACY to replace 16
authorYinghai Lu <yinghai@kernel.org>
Mon, 9 Feb 2009 00:18:03 +0000 (16:18 -0800)
committerIngo Molnar <mingo@elte.hu>
Mon, 9 Feb 2009 08:21:28 +0000 (09:21 +0100)
Impact: cleanup

also could kill platform_legacy_irq

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/include/asm/hw_irq.h
arch/x86/kernel/io_apic.c

index 1a20e3d1200609bb41f4f67e952907d0f0f4b2c8..1b82781b898d3bd374aebc2fa85e2e9d2fd84172 100644 (file)
@@ -25,8 +25,6 @@
 #include <asm/irq.h>
 #include <asm/sections.h>
 
-#define platform_legacy_irq(irq)       ((irq) < 16)
-
 /* Interrupt handlers registered during init_IRQ */
 extern void apic_timer_interrupt(void);
 extern void error_interrupt(void);
@@ -58,7 +56,7 @@ extern void make_8259A_irq(unsigned int irq);
 extern void init_8259A(int aeoi);
 
 /* IOAPIC */
-#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
+#define IO_APIC_IRQ(x) (((x) >= NR_IRQS_LEGACY) || ((1<<(x)) & io_apic_irqs))
 extern unsigned long io_apic_irqs;
 
 extern void init_VISWS_APIC_irqs(void);
index 43f95d7b13afdc9f60b24c23b6898503c7df9d3a..e5be9f35ea5434191670465621b89fff2c9c772a 100644 (file)
@@ -3165,6 +3165,7 @@ static int __init ioapic_init_sysfs(void)
 
 device_initcall(ioapic_init_sysfs);
 
+static int nr_irqs_gsi = NR_IRQS_LEGACY;
 /*
  * Dynamic irq allocate and deallocation
  */
@@ -3179,11 +3180,11 @@ unsigned int create_irq_nr(unsigned int irq_want)
        struct irq_desc *desc_new = NULL;
 
        irq = 0;
+       if (irq_want < nr_irqs_gsi)
+               irq_want = nr_irqs_gsi;
+
        spin_lock_irqsave(&vector_lock, flags);
        for (new = irq_want; new < nr_irqs; new++) {
-               if (platform_legacy_irq(new))
-                       continue;
-
                desc_new = irq_to_desc_alloc_cpu(new, cpu);
                if (!desc_new) {
                        printk(KERN_INFO "can not get irq_desc for %d\n", new);
@@ -3208,7 +3209,6 @@ unsigned int create_irq_nr(unsigned int irq_want)
        return irq;
 }
 
-static int nr_irqs_gsi = NR_IRQS_LEGACY;
 int create_irq(void)
 {
        unsigned int irq_want;