aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/x86/lapic/lapic_cpu_init.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-18 12:11:16 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-08-19 15:30:40 +0000
commitff284f656606548f122c59a9ffb6ab453ca89149 (patch)
treef04801df002509c12a735dbfa7a5fa91d9857850 /src/cpu/x86/lapic/lapic_cpu_init.c
parentaeb2d64c85ca2c3a77f50d57e3a92f6fc0a5c2d3 (diff)
arch/x86: Fix ugly NEED_LAPIC use
Change-Id: I2d6fdfd0465fe5f558daa04c6f980f7226596b55 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/21087 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/cpu/x86/lapic/lapic_cpu_init.c')
-rw-r--r--src/cpu/x86/lapic/lapic_cpu_init.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c
index 83be53b22d..ce4d0f588e 100644
--- a/src/cpu/x86/lapic/lapic_cpu_init.c
+++ b/src/cpu/x86/lapic/lapic_cpu_init.c
@@ -541,18 +541,18 @@ void initialize_cpus(struct bus *cpu_bus)
/* Find the info struct for this CPU */
info = cpu_info();
-#if NEED_LAPIC == 1
- /* Ensure the local APIC is enabled */
- enable_lapic();
-
- /* Get the device path of the boot CPU */
- cpu_path.type = DEVICE_PATH_APIC;
- cpu_path.apic.apic_id = lapicid();
-#else
- /* Get the device path of the boot CPU */
- cpu_path.type = DEVICE_PATH_CPU;
- cpu_path.cpu.id = 0;
-#endif
+ if (need_lapic_init()) {
+ /* Ensure the local APIC is enabled */
+ enable_lapic();
+
+ /* Get the device path of the boot CPU */
+ cpu_path.type = DEVICE_PATH_APIC;
+ cpu_path.apic.apic_id = lapicid();
+ } else {
+ /* Get the device path of the boot CPU */
+ cpu_path.type = DEVICE_PATH_CPU;
+ cpu_path.cpu.id = 0;
+ }
/* Find the device structure for the boot CPU */
info->cpu = alloc_find_dev(cpu_bus, &cpu_path);