Attention is currently required from: Cliff Huang, Jincheng Li, Lance Zhao, Tim Wawrzynczak.
Hello Jincheng Li,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/84324?usp=email
to review the following change.
Change subject: acpi: Create MADT lapic entries according to current lapic mode ......................................................................
acpi: Create MADT lapic entries according to current lapic mode
Introduce a new function is_x2apic_mode() to tell current lapic mode and create the lapic entries accordingly.
Expose is_x2apic_mode() from x86 to common
Change-Id: I197ceeabd8a789abcd72459493a63ea267af4a16 Signed-off-by: Jincheng Li jincheng.li@intel.com --- M src/acpi/acpi_apic.c 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/84324/1
diff --git a/src/acpi/acpi_apic.c b/src/acpi/acpi_apic.c index fe0459b..d64b6c1 100644 --- a/src/acpi/acpi_apic.c +++ b/src/acpi/acpi_apic.c @@ -3,9 +3,11 @@ #include <acpi/acpi.h> #include <arch/ioapic.h> #include <arch/smp/mpspec.h> +#include <assert.h> #include <commonlib/sort.h> #include <cpu/cpu.h> #include <device/device.h> +#include <cpu/x86/lapic.h>
static int acpi_create_madt_lapic(acpi_madt_lapic_t *lapic, u8 cpu, u8 apic) { @@ -32,9 +34,11 @@
unsigned long acpi_create_madt_one_lapic(unsigned long current, u32 index, u32 lapic_id) { - if (lapic_id <= ACPI_MADT_MAX_LAPIC_ID) + if (!is_x2apic_mode()) { + assert(lapic_id <= ACPI_MADT_MAX_LAPIC_ID); current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, index, lapic_id); + } else current += acpi_create_madt_lx2apic((acpi_madt_lx2apic_t *)current, index, lapic_id);