summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/acpi.c12
-rw-r--r--src/arch/x86/cpu.c5
2 files changed, 15 insertions, 2 deletions
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index 5c15a5e6af..8e7b51d79d 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -22,7 +22,6 @@
#include <device/pci.h>
#include <cbmem.h>
#include <commonlib/helpers.h>
-#include <cpu/x86/lapic_def.h>
#include <cpu/cpu.h>
#include <cbfs.h>
#include <version.h>
@@ -222,6 +221,15 @@ int acpi_create_madt_lx2apic_nmi(acpi_madt_lx2apic_nmi_t *lapic_nmi, u32 cpu,
return lapic_nmi->length;
}
+__weak uintptr_t cpu_get_lapic_addr(void)
+{
+ /*
+ * If an architecture does not support LAPIC, this weak implementation returns LAPIC
+ * addr as 0.
+ */
+ return 0;
+}
+
void acpi_create_madt(acpi_madt_t *madt)
{
acpi_header_t *header = &(madt->header);
@@ -242,7 +250,7 @@ void acpi_create_madt(acpi_madt_t *madt)
header->length = sizeof(acpi_madt_t);
header->revision = get_acpi_table_revision(MADT);
- madt->lapic_addr = LOCAL_APIC_ADDR;
+ madt->lapic_addr = cpu_get_lapic_addr();
if (CONFIG(ACPI_HAVE_PCAT_8259))
madt->flags |= 1;
diff --git a/src/arch/x86/cpu.c b/src/arch/x86/cpu.c
index 1ee8fb32c3..b52376885f 100644
--- a/src/arch/x86/cpu.c
+++ b/src/arch/x86/cpu.c
@@ -354,3 +354,8 @@ int cpu_index(void)
}
return -1;
}
+
+uintptr_t cpu_get_lapic_addr(void)
+{
+ return LOCAL_APIC_ADDR;
+}