]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/include/asm/irq_vectors.h
irq: initialize nr_irqs based on nr_cpu_ids
[linux-2.6-omap-h63xx.git] / arch / x86 / include / asm / irq_vectors.h
index 0005adb0f941f5f564cbad634538db8b149f0f46..602361ad0e746a5c8dadd8975a6c5b1b16a571a9 100644 (file)
 #define LAST_VM86_IRQ          15
 #define invalid_vm86_irq(irq)  ((irq) < 3 || (irq) > 15)
 
+#define NR_IRQS_LEGACY         16
+
 #if defined(CONFIG_X86_IO_APIC) && !defined(CONFIG_X86_VOYAGER)
+
+#include <asm/apicnum.h>       /* need MAX_IO_APICS */
+
+#ifndef CONFIG_SPARSE_IRQ
 # if NR_CPUS < MAX_IO_APICS
 #  define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
 # else
 #  define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
 # endif
+#else
+
+/* defined as a macro so nr_irqs = max_nr_irqs(nr_cpu_ids) can be used */
+# define max_nr_irqs(nr_cpus)                          \
+       ((8 * nr_cpus) > (32 * MAX_IO_APICS) ?          \
+               (NR_VECTORS + (8 * NR_CPUS)) :          \
+               (NR_VECTORS + (32 * MAX_IO_APICS)))     \
+
+# define NR_IRQS max_nr_irqs(NR_CPUS)
+
+#endif
 
 #elif defined(CONFIG_X86_VOYAGER)