aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irqinit_32.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-19 23:50:28 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:52:53 -0400
commit497c9a195db918d3f035e8cb3021e5d4d035516e (patch)
tree73df8764a812f2d6d2bd81d6a1d671008a0d212b /arch/x86/kernel/irqinit_32.c
parent199751d715bba5b469ea22adadc68a4166bfa4f5 (diff)
x86: make 32bit support per_cpu vector
so we can merge io_apic_32.c and io_apic_64.c v2: Use cpu_online_map as target cpus for bigsmp, just like 64-bit is doing. Also remove some unused TARGET_CPUS macro. v3: need to check if desc is null in smp_irq_move_cleanup also migration needs to reset vector too, so copy __target_IO_APIC_irq from 64bit. (the duplication will go away once the two files are unified.) Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/irqinit_32.c')
-rw-r--r--arch/x86/kernel/irqinit_32.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index ded09ac2642e..9092103a18eb 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -90,6 +90,27 @@ static struct irqaction irq2 = {
90 .name = "cascade", 90 .name = "cascade",
91}; 91};
92 92
93DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
94 [0 ... IRQ0_VECTOR - 1] = -1,
95 [IRQ0_VECTOR] = 0,
96 [IRQ1_VECTOR] = 1,
97 [IRQ2_VECTOR] = 2,
98 [IRQ3_VECTOR] = 3,
99 [IRQ4_VECTOR] = 4,
100 [IRQ5_VECTOR] = 5,
101 [IRQ6_VECTOR] = 6,
102 [IRQ7_VECTOR] = 7,
103 [IRQ8_VECTOR] = 8,
104 [IRQ9_VECTOR] = 9,
105 [IRQ10_VECTOR] = 10,
106 [IRQ11_VECTOR] = 11,
107 [IRQ12_VECTOR] = 12,
108 [IRQ13_VECTOR] = 13,
109 [IRQ14_VECTOR] = 14,
110 [IRQ15_VECTOR] = 15,
111 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1
112};
113
93/* Overridden in paravirt.c */ 114/* Overridden in paravirt.c */
94void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); 115void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
95 116
@@ -105,22 +126,14 @@ void __init native_init_IRQ(void)
105 * us. (some of these will be overridden and become 126 * us. (some of these will be overridden and become
106 * 'special' SMP interrupts) 127 * 'special' SMP interrupts)
107 */ 128 */
108 for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { 129 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
109 int vector = FIRST_EXTERNAL_VECTOR + i;
110 if (i >= nr_irqs)
111 break;
112 /* SYSCALL_VECTOR was reserved in trap_init. */ 130 /* SYSCALL_VECTOR was reserved in trap_init. */
113 if (!test_bit(vector, used_vectors)) 131 if (i != SYSCALL_VECTOR)
114 set_intr_gate(vector, interrupt[i]); 132 set_intr_gate(i, interrupt[i]);
115 } 133 }
116 134
117#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP)
118 /*
119 * IRQ0 must be given a fixed assignment and initialized,
120 * because it's used before the IO-APIC is set up.
121 */
122 set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]);
123 135
136#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP)
124 /* 137 /*
125 * The reschedule interrupt is a CPU-to-CPU reschedule-helper 138 * The reschedule interrupt is a CPU-to-CPU reschedule-helper
126 * IPI, driven by wakeup. 139 * IPI, driven by wakeup.
@@ -135,6 +148,9 @@ void __init native_init_IRQ(void)
135 148
136 /* IPI for single call function */ 149 /* IPI for single call function */
137 set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt); 150 set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt);
151
152 /* Low priority IPI to cleanup after moving an irq */
153 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
138#endif 154#endif
139 155
140#ifdef CONFIG_X86_LOCAL_APIC 156#ifdef CONFIG_X86_LOCAL_APIC
@@ -168,3 +184,4 @@ void __init native_init_IRQ(void)
168 184
169 irq_ctx_init(smp_processor_id()); 185 irq_ctx_init(smp_processor_id());
170} 186}
187