From ff284f656606548f122c59a9ffb6ab453ca89149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 18 Aug 2017 12:11:16 +0300 Subject: arch/x86: Fix ugly NEED_LAPIC use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2d6fdfd0465fe5f558daa04c6f980f7226596b55 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/21087 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/cpu/x86/lapic/lapic_cpu_init.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/cpu/x86/lapic/lapic_cpu_init.c') 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); -- cgit v1.2.3