diff options
author | Brian Gerst <brgerst@gmail.com> | 2015-05-09 11:36:53 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-10 06:34:28 -0400 |
commit | 8b455e6577f325289cf2d1b20f493b2fe5c6c316 (patch) | |
tree | 4cd29969de44653d776ffca57060c61d865d8d89 | |
parent | 51bb92843edcba5a58138cad25ced97923048add (diff) |
x86/asm/entry/irq: Clean up IRQn_VECTOR macros
Since the ISA irqs are in a single block, use
ISA_IRQ_VECTOR(irq) instead of individual macros.
Signed-off-by: Brian Gerst <brgerst@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1431185813-15413-5-git-send-email-brgerst@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/irq_vectors.h | 18 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/vector.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/i8259.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/irqinit.c | 4 |
5 files changed, 10 insertions, 26 deletions
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 07f27926d473..117db96ad5fb 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h | |||
@@ -52,23 +52,7 @@ | |||
52 | * Vectors 0x30-0x3f are used for ISA interrupts. | 52 | * Vectors 0x30-0x3f are used for ISA interrupts. |
53 | * round up to the next 16-vector boundary | 53 | * round up to the next 16-vector boundary |
54 | */ | 54 | */ |
55 | #define IRQ0_VECTOR ((FIRST_EXTERNAL_VECTOR + 16) & ~15) | 55 | #define ISA_IRQ_VECTOR(irq) (((FIRST_EXTERNAL_VECTOR + 16) & ~15) + irq) |
56 | |||
57 | #define IRQ1_VECTOR (IRQ0_VECTOR + 1) | ||
58 | #define IRQ2_VECTOR (IRQ0_VECTOR + 2) | ||
59 | #define IRQ3_VECTOR (IRQ0_VECTOR + 3) | ||
60 | #define IRQ4_VECTOR (IRQ0_VECTOR + 4) | ||
61 | #define IRQ5_VECTOR (IRQ0_VECTOR + 5) | ||
62 | #define IRQ6_VECTOR (IRQ0_VECTOR + 6) | ||
63 | #define IRQ7_VECTOR (IRQ0_VECTOR + 7) | ||
64 | #define IRQ8_VECTOR (IRQ0_VECTOR + 8) | ||
65 | #define IRQ9_VECTOR (IRQ0_VECTOR + 9) | ||
66 | #define IRQ10_VECTOR (IRQ0_VECTOR + 10) | ||
67 | #define IRQ11_VECTOR (IRQ0_VECTOR + 11) | ||
68 | #define IRQ12_VECTOR (IRQ0_VECTOR + 12) | ||
69 | #define IRQ13_VECTOR (IRQ0_VECTOR + 13) | ||
70 | #define IRQ14_VECTOR (IRQ0_VECTOR + 14) | ||
71 | #define IRQ15_VECTOR (IRQ0_VECTOR + 15) | ||
72 | 56 | ||
73 | /* | 57 | /* |
74 | * Special IRQ vectors used by the SMP architecture, 0xf0-0xff | 58 | * Special IRQ vectors used by the SMP architecture, 0xf0-0xff |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index f4dc2462a1ac..e01e4117188a 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -258,11 +258,11 @@ int __init arch_early_ioapic_init(void) | |||
258 | 258 | ||
259 | /* | 259 | /* |
260 | * For legacy IRQ's, start with assigning irq0 to irq15 to | 260 | * For legacy IRQ's, start with assigning irq0 to irq15 to |
261 | * IRQ0_VECTOR to IRQ15_VECTOR for all cpu's. | 261 | * ISA_IRQ_VECTOR(irq) for all cpu's. |
262 | */ | 262 | */ |
263 | for (i = 0; i < nr_legacy_irqs(); i++) { | 263 | for (i = 0; i < nr_legacy_irqs(); i++) { |
264 | cfg = alloc_irq_and_cfg_at(i, node); | 264 | cfg = alloc_irq_and_cfg_at(i, node); |
265 | cfg->vector = IRQ0_VECTOR + i; | 265 | cfg->vector = ISA_IRQ_VECTOR(i); |
266 | cpumask_setall(cfg->domain); | 266 | cpumask_setall(cfg->domain); |
267 | } | 267 | } |
268 | 268 | ||
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 6cedd7914581..82d44c314a3f 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c | |||
@@ -314,7 +314,7 @@ void setup_vector_irq(int cpu) | |||
314 | * legacy vector to irq mapping: | 314 | * legacy vector to irq mapping: |
315 | */ | 315 | */ |
316 | for (irq = 0; irq < nr_legacy_irqs(); irq++) | 316 | for (irq = 0; irq < nr_legacy_irqs(); irq++) |
317 | per_cpu(vector_irq, cpu)[IRQ0_VECTOR + irq] = irq; | 317 | per_cpu(vector_irq, cpu)[ISA_IRQ_VECTOR(irq)] = irq; |
318 | 318 | ||
319 | __setup_vector_irq(cpu); | 319 | __setup_vector_irq(cpu); |
320 | } | 320 | } |
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index e7cc5370cd2f..16cb827a5b27 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -329,8 +329,8 @@ static void init_8259A(int auto_eoi) | |||
329 | */ | 329 | */ |
330 | outb_pic(0x11, PIC_MASTER_CMD); /* ICW1: select 8259A-1 init */ | 330 | outb_pic(0x11, PIC_MASTER_CMD); /* ICW1: select 8259A-1 init */ |
331 | 331 | ||
332 | /* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 */ | 332 | /* ICW2: 8259A-1 IR0-7 mapped to ISA_IRQ_VECTOR(0) */ |
333 | outb_pic(IRQ0_VECTOR, PIC_MASTER_IMR); | 333 | outb_pic(ISA_IRQ_VECTOR(0), PIC_MASTER_IMR); |
334 | 334 | ||
335 | /* 8259A-1 (the master) has a slave on IR2 */ | 335 | /* 8259A-1 (the master) has a slave on IR2 */ |
336 | outb_pic(1U << PIC_CASCADE_IR, PIC_MASTER_IMR); | 336 | outb_pic(1U << PIC_CASCADE_IR, PIC_MASTER_IMR); |
@@ -342,8 +342,8 @@ static void init_8259A(int auto_eoi) | |||
342 | 342 | ||
343 | outb_pic(0x11, PIC_SLAVE_CMD); /* ICW1: select 8259A-2 init */ | 343 | outb_pic(0x11, PIC_SLAVE_CMD); /* ICW1: select 8259A-2 init */ |
344 | 344 | ||
345 | /* ICW2: 8259A-2 IR0-7 mapped to IRQ8_VECTOR */ | 345 | /* ICW2: 8259A-2 IR0-7 mapped to ISA_IRQ_VECTOR(8) */ |
346 | outb_pic(IRQ8_VECTOR, PIC_SLAVE_IMR); | 346 | outb_pic(ISA_IRQ_VECTOR(8), PIC_SLAVE_IMR); |
347 | /* 8259A-2 is a slave on master's IR2 */ | 347 | /* 8259A-2 is a slave on master's IR2 */ |
348 | outb_pic(PIC_CASCADE_IR, PIC_SLAVE_IMR); | 348 | outb_pic(PIC_CASCADE_IR, PIC_SLAVE_IMR); |
349 | /* (slave's support for AEOI in flat mode is to be investigated) */ | 349 | /* (slave's support for AEOI in flat mode is to be investigated) */ |
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index cd10a6437264..dc1e08d23552 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
@@ -86,7 +86,7 @@ void __init init_IRQ(void) | |||
86 | int i; | 86 | int i; |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * On cpu 0, Assign IRQ0_VECTOR..IRQ15_VECTOR's to IRQ 0..15. | 89 | * On cpu 0, Assign ISA_IRQ_VECTOR(irq) to IRQ 0..15. |
90 | * If these IRQ's are handled by legacy interrupt-controllers like PIC, | 90 | * If these IRQ's are handled by legacy interrupt-controllers like PIC, |
91 | * then this configuration will likely be static after the boot. If | 91 | * then this configuration will likely be static after the boot. If |
92 | * these IRQ's are handled by more mordern controllers like IO-APIC, | 92 | * these IRQ's are handled by more mordern controllers like IO-APIC, |
@@ -94,7 +94,7 @@ void __init init_IRQ(void) | |||
94 | * irq's migrate etc. | 94 | * irq's migrate etc. |
95 | */ | 95 | */ |
96 | for (i = 0; i < nr_legacy_irqs(); i++) | 96 | for (i = 0; i < nr_legacy_irqs(); i++) |
97 | per_cpu(vector_irq, 0)[IRQ0_VECTOR + i] = i; | 97 | per_cpu(vector_irq, 0)[ISA_IRQ_VECTOR(i)] = i; |
98 | 98 | ||
99 | x86_init.irqs.intr_init(); | 99 | x86_init.irqs.intr_init(); |
100 | } | 100 | } |