aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/i8259.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2006-10-04 05:16:50 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:28 -0400
commite500f57436b9056a245216c53113613928155eba (patch)
tree2b93aae3dfbe82fd5387ec7e0cb5945951655d07 /arch/x86_64/kernel/i8259.c
parent23d0b8b053391afe15c9667d80de77ca88e18b8b (diff)
[PATCH] genirq: x86_64 irq: Make the external irq handlers report their vector, not the irq number
This is a small pessimization but it paves the way for making this information per cpu. Which allows the the maximum number of IRQS to become NR_CPUS*224. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Rajesh Shah <rajesh.shah@intel.com> Cc: Andi Kleen <ak@muc.de> Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/i8259.c')
-rw-r--r--arch/x86_64/kernel/i8259.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index ae1101cd5252..bddde431871a 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -43,17 +43,10 @@
43 BI(x,8) BI(x,9) BI(x,a) BI(x,b) \ 43 BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
44 BI(x,c) BI(x,d) BI(x,e) BI(x,f) 44 BI(x,c) BI(x,d) BI(x,e) BI(x,f)
45 45
46#define BUILD_15_IRQS(x) \
47 BI(x,0) BI(x,1) BI(x,2) BI(x,3) \
48 BI(x,4) BI(x,5) BI(x,6) BI(x,7) \
49 BI(x,8) BI(x,9) BI(x,a) BI(x,b) \
50 BI(x,c) BI(x,d) BI(x,e)
51
52/* 46/*
53 * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts: 47 * ISA PIC or low IO-APIC triggered (INTA-cycle or APIC) interrupts:
54 * (these are usually mapped to vectors 0x20-0x2f) 48 * (these are usually mapped to vectors 0x20-0x2f)
55 */ 49 */
56BUILD_16_IRQS(0x0)
57 50
58/* 51/*
59 * The IO-APIC gives us many more interrupt sources. Most of these 52 * The IO-APIC gives us many more interrupt sources. Most of these
@@ -65,17 +58,12 @@ BUILD_16_IRQS(0x0)
65 * 58 *
66 * (these are usually mapped into the 0x30-0xff vector range) 59 * (these are usually mapped into the 0x30-0xff vector range)
67 */ 60 */
68 BUILD_16_IRQS(0x1) BUILD_16_IRQS(0x2) BUILD_16_IRQS(0x3) 61 BUILD_16_IRQS(0x2) BUILD_16_IRQS(0x3)
69BUILD_16_IRQS(0x4) BUILD_16_IRQS(0x5) BUILD_16_IRQS(0x6) BUILD_16_IRQS(0x7) 62BUILD_16_IRQS(0x4) BUILD_16_IRQS(0x5) BUILD_16_IRQS(0x6) BUILD_16_IRQS(0x7)
70BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb) 63BUILD_16_IRQS(0x8) BUILD_16_IRQS(0x9) BUILD_16_IRQS(0xa) BUILD_16_IRQS(0xb)
71BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) 64BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd) BUILD_16_IRQS(0xe) BUILD_16_IRQS(0xf)
72
73#ifdef CONFIG_PCI_MSI
74 BUILD_15_IRQS(0xe)
75#endif
76 65
77#undef BUILD_16_IRQS 66#undef BUILD_16_IRQS
78#undef BUILD_15_IRQS
79#undef BI 67#undef BI
80 68
81 69
@@ -88,29 +76,15 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
88 IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \ 76 IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
89 IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f) 77 IRQ(x,c), IRQ(x,d), IRQ(x,e), IRQ(x,f)
90 78
91#define IRQLIST_15(x) \
92 IRQ(x,0), IRQ(x,1), IRQ(x,2), IRQ(x,3), \
93 IRQ(x,4), IRQ(x,5), IRQ(x,6), IRQ(x,7), \
94 IRQ(x,8), IRQ(x,9), IRQ(x,a), IRQ(x,b), \
95 IRQ(x,c), IRQ(x,d), IRQ(x,e)
96
97void (*interrupt[NR_IRQS])(void) = { 79void (*interrupt[NR_IRQS])(void) = {
98 IRQLIST_16(0x0), 80 IRQLIST_16(0x2), IRQLIST_16(0x3),
99
100 IRQLIST_16(0x1), IRQLIST_16(0x2), IRQLIST_16(0x3),
101 IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7), 81 IRQLIST_16(0x4), IRQLIST_16(0x5), IRQLIST_16(0x6), IRQLIST_16(0x7),
102 IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb), 82 IRQLIST_16(0x8), IRQLIST_16(0x9), IRQLIST_16(0xa), IRQLIST_16(0xb),
103 IRQLIST_16(0xc), IRQLIST_16(0xd) 83 IRQLIST_16(0xc), IRQLIST_16(0xd), IRQLIST_16(0xe), IRQLIST_16(0xf)
104
105#ifdef CONFIG_PCI_MSI
106 , IRQLIST_15(0xe)
107#endif
108
109}; 84};
110 85
111#undef IRQ 86#undef IRQ
112#undef IRQLIST_16 87#undef IRQLIST_16
113#undef IRQLIST_14
114 88
115/* 89/*
116 * This is the 'legacy' 8259A Programmable Interrupt Controller, 90 * This is the 'legacy' 8259A Programmable Interrupt Controller,
@@ -420,6 +394,26 @@ device_initcall(i8259A_init_sysfs);
420 */ 394 */
421 395
422static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL}; 396static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL};
397int vector_irq[NR_VECTORS] __read_mostly = {
398 [0 ... FIRST_EXTERNAL_VECTOR - 1] = -1,
399 [FIRST_EXTERNAL_VECTOR + 0] = 0,
400 [FIRST_EXTERNAL_VECTOR + 1] = 1,
401 [FIRST_EXTERNAL_VECTOR + 2] = 2,
402 [FIRST_EXTERNAL_VECTOR + 3] = 3,
403 [FIRST_EXTERNAL_VECTOR + 4] = 4,
404 [FIRST_EXTERNAL_VECTOR + 5] = 5,
405 [FIRST_EXTERNAL_VECTOR + 6] = 6,
406 [FIRST_EXTERNAL_VECTOR + 7] = 7,
407 [FIRST_EXTERNAL_VECTOR + 8] = 8,
408 [FIRST_EXTERNAL_VECTOR + 9] = 9,
409 [FIRST_EXTERNAL_VECTOR + 10] = 10,
410 [FIRST_EXTERNAL_VECTOR + 11] = 11,
411 [FIRST_EXTERNAL_VECTOR + 12] = 12,
412 [FIRST_EXTERNAL_VECTOR + 13] = 13,
413 [FIRST_EXTERNAL_VECTOR + 14] = 14,
414 [FIRST_EXTERNAL_VECTOR + 15] = 15,
415 [FIRST_EXTERNAL_VECTOR + 16 ... NR_VECTORS - 1] = -1
416};
423 417
424void __init init_ISA_irqs (void) 418void __init init_ISA_irqs (void)
425{ 419{
@@ -517,8 +511,6 @@ void __init init_IRQ(void)
517 */ 511 */
518 for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { 512 for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) {
519 int vector = FIRST_EXTERNAL_VECTOR + i; 513 int vector = FIRST_EXTERNAL_VECTOR + i;
520 if (i >= NR_IRQS)
521 break;
522 if (vector != IA32_SYSCALL_VECTOR) 514 if (vector != IA32_SYSCALL_VECTOR)
523 set_intr_gate(vector, interrupt[i]); 515 set_intr_gate(vector, interrupt[i]);
524 } 516 }
@@ -528,7 +520,7 @@ void __init init_IRQ(void)
528 * IRQ0 must be given a fixed assignment and initialized, 520 * IRQ0 must be given a fixed assignment and initialized,
529 * because it's used before the IO-APIC is set up. 521 * because it's used before the IO-APIC is set up.
530 */ 522 */
531 set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); 523 vector_irq[FIRST_DEVICE_VECTOR] = 0;
532 524
533 /* 525 /*
534 * The reschedule interrupt is a CPU-to-CPU reschedule-helper 526 * The reschedule interrupt is a CPU-to-CPU reschedule-helper