aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-01-15 21:22:40 +0000
committerThomas Gleixner <tglx@linutronix.de>2015-01-22 15:10:56 +0100
commit05f7e46d2aac359b6bcfc06b302bdd03ca0bcada (patch)
tree5cceda7511f92c08fbef5a9d2a0f8dd6f9642ae5 /arch/x86/kernel/smpboot.c
parent30b8b0066cafef274fc92462578ee346211ce7cb (diff)
x86/smpboot: Move apic init code to apic.c
We better provide proper functions which implement the required code flow in the apic code rather than letting the smpboot code open code it. That allows to make more functions static and confines the APIC functionality to apic.c where it belongs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Borislav Petkov <bp@alien8.de> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: Tony Luck <tony.luck@intel.com> Link: http://lkml.kernel.org/r/20150115211703.907616730@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index ca7f7b696f07..d53870928824 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -172,8 +172,7 @@ static void smp_callin(void)
* CPU, first the APIC. (this is probably redundant on most
* boards)
*/
- setup_local_APIC();
- end_local_APIC_setup();
+ apic_ap_setup();
/*
* Need to setup vector mappings before we enable interrupts.
@@ -1078,7 +1077,6 @@ static int __init smp_sanity_check(unsigned max_cpus)
boot_cpu_physical_apicid);
pr_err("... forcing use of dummy APIC emulation (tell your hw vendor)\n");
}
- disable_ioapic_support();
return -1;
}
@@ -1090,10 +1088,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
if (!max_cpus) {
pr_info("SMP mode deactivated\n");
disable_ioapic_support();
-
- connect_bsp_APIC();
- setup_local_APIC();
- bsp_end_local_APIC_setup();
+ apic_bsp_setup();
return -1;
}
@@ -1151,23 +1146,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
/* Or can we switch back to PIC here? */
}
- connect_bsp_APIC();
-
- /*
- * Switch from PIC to APIC mode.
- */
- setup_local_APIC();
-
- if (x2apic_mode)
- cpu0_logical_apicid = apic_read(APIC_LDR);
- else
- cpu0_logical_apicid = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR));
-
- /* Enable IO APIC before setting up error vector */
- enable_IO_APIC();
-
- bsp_end_local_APIC_setup();
- setup_IO_APIC();
+ cpu0_logical_apicid = apic_bsp_setup();
/*
* Set up local APIC timer on boot CPU.