aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-05-28 23:34:19 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 06:48:21 -0400
commit3fde690011a84e19f98f77bfaa349b2119ddd2d2 (patch)
tree82222565bdbf209893a7af884b157c2972ce0984
parent86e430edf462e872ecfab28d6b8619be5ab9c300 (diff)
x86: change __setup_vector_irq with setup_vector_irq
We create a version of it for i386, and then take the CONFIG_X86_64 ifdef out of the game. We could create a __setup_vector_irq for i386, but it would incur in an unnecessary lock taking. Moreover, it is better practice to only export setup_vector_irq anyway. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/io_apic_32.c5
-rw-r--r--arch/x86/kernel/io_apic_64.c9
-rw-r--r--arch/x86/kernel/smpboot.c11
-rw-r--r--include/asm-x86/hw_irq.h2
4 files changed, 16 insertions, 11 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index fedb3b113ace..d6af301c822b 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -1207,6 +1207,11 @@ static int assign_irq_vector(int irq)
1207 1207
1208 return vector; 1208 return vector;
1209} 1209}
1210
1211void setup_vector_irq(int cpu)
1212{
1213}
1214
1210static struct irq_chip ioapic_chip; 1215static struct irq_chip ioapic_chip;
1211 1216
1212#define IOAPIC_AUTO -1 1217#define IOAPIC_AUTO -1
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
index 2eba4f4c14ba..08c48750888a 100644
--- a/arch/x86/kernel/io_apic_64.c
+++ b/arch/x86/kernel/io_apic_64.c
@@ -801,7 +801,7 @@ static void __clear_irq_vector(int irq)
801 cpus_clear(cfg->domain); 801 cpus_clear(cfg->domain);
802} 802}
803 803
804void __setup_vector_irq(int cpu) 804static void __setup_vector_irq(int cpu)
805{ 805{
806 /* Initialize vector_irq on a new cpu */ 806 /* Initialize vector_irq on a new cpu */
807 /* This function must be called with vector_lock held */ 807 /* This function must be called with vector_lock held */
@@ -824,6 +824,13 @@ void __setup_vector_irq(int cpu)
824 } 824 }
825} 825}
826 826
827void setup_vector_irq(int cpu)
828{
829 spin_lock(&vector_lock);
830 __setup_vector_irq(smp_processor_id());
831 spin_unlock(&vector_lock);
832}
833
827 834
828static struct irq_chip ioapic_chip; 835static struct irq_chip ioapic_chip;
829 836
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 6f9a31a18811..e09f3124738a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -329,15 +329,8 @@ static void __cpuinit start_secondary(void *unused)
329 * smp_call_function(). 329 * smp_call_function().
330 */ 330 */
331 lock_ipi_call_lock(); 331 lock_ipi_call_lock();
332#ifdef CONFIG_X86_64 332#ifdef CONFIG_X86_IO_APIC
333 spin_lock(&vector_lock); 333 setup_vector_irq(smp_processor_id());
334
335 /* Setup the per cpu irq handling data structures */
336 __setup_vector_irq(smp_processor_id());
337 /*
338 * Allow the master to continue.
339 */
340 spin_unlock(&vector_lock);
341#endif 334#endif
342 cpu_set(smp_processor_id(), cpu_online_map); 335 cpu_set(smp_processor_id(), cpu_online_map);
343 unlock_ipi_call_lock(); 336 unlock_ipi_call_lock();
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h
index 1428b41dcbb9..18f067c310f7 100644
--- a/include/asm-x86/hw_irq.h
+++ b/include/asm-x86/hw_irq.h
@@ -97,9 +97,9 @@ extern void (*const interrupt[NR_IRQS])(void);
97#else 97#else
98typedef int vector_irq_t[NR_VECTORS]; 98typedef int vector_irq_t[NR_VECTORS];
99DECLARE_PER_CPU(vector_irq_t, vector_irq); 99DECLARE_PER_CPU(vector_irq_t, vector_irq);
100extern void __setup_vector_irq(int cpu);
101extern spinlock_t vector_lock; 100extern spinlock_t vector_lock;
102#endif 101#endif
102extern void setup_vector_irq(int cpu);
103 103
104#endif /* !ASSEMBLY_ */ 104#endif /* !ASSEMBLY_ */
105 105