Skip to content

Commit ef041c6

Browse files
carlescufinashif
authored andcommitted
modules: acpica: Fix header inclusion issue
After 79d0bf3 was merged, the inclusion of <zephyr/acpi/acpi.h> with CONFIG_ACPI=n caused a build failure because <acpica/source/include/acpi.h> could no longer be included due to the inlcude path not being injected anymore. Fix this by guarding the header inclusion when CONFIG_ACPI is not set. Fixes #62679. Signed-off-by: Carles Cufi <[email protected]>
1 parent d42d14e commit ef041c6

File tree

1 file changed

+8
-6
lines changed
  • arch/x86/core/intel64

1 file changed

+8
-6
lines changed

arch/x86/core/intel64/cpu.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#include <zephyr/arch/x86/multiboot.h>
1212
#include <x86_mmu.h>
1313
#include <zephyr/drivers/interrupt_controller/loapic.h>
14+
#ifdef CONFIG_ACPI
1415
#include <zephyr/acpi/acpi.h>
16+
#endif
1517

1618
BUILD_ASSERT(CONFIG_MP_MAX_NUM_CPUS <= 4, "Only supports max 4 CPUs");
1719

@@ -142,14 +144,14 @@ void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
142144
uint8_t vector = ((unsigned long) x86_ap_start) >> 12;
143145
uint8_t apic_id;
144146

145-
if (IS_ENABLED(CONFIG_ACPI)) {
146-
struct acpi_madt_local_apic *lapic = acpi_local_apic_get(cpu_num);
147+
#ifdef CONFIG_ACPI
148+
struct acpi_madt_local_apic *lapic = acpi_local_apic_get(cpu_num);
147149

148-
if (lapic != NULL) {
149-
/* We update the apic_id, __start will need it. */
150-
x86_cpu_loapics[cpu_num] = lapic->Id;
151-
}
150+
if (lapic != NULL) {
151+
/* We update the apic_id, __start will need it. */
152+
x86_cpu_loapics[cpu_num] = lapic->Id;
152153
}
154+
#endif
153155

154156
apic_id = x86_cpu_loapics[cpu_num];
155157

0 commit comments

Comments
 (0)