From ead385dd1753a09941125b0e005b673e8ddad44f Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 9 Jul 2019 18:27:13 +0200 Subject: [PATCH] base-nova: EFI sys-table pointer in platform info Ref #3430 --- repos/base-nova/include/nova/syscall-generic.h | 1 + repos/base-nova/src/core/platform.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/repos/base-nova/include/nova/syscall-generic.h b/repos/base-nova/include/nova/syscall-generic.h index 9f9bc7f72b..ffdb09f065 100644 --- a/repos/base-nova/include/nova/syscall-generic.h +++ b/repos/base-nova/include/nova/syscall-generic.h @@ -91,6 +91,7 @@ namespace Nova { struct Mem_desc { enum Type { + EFI_SYSTEM_TABLE = -7, HYPERVISOR_LOG = -6, FRAMEBUFFER = -5, ACPI_XSDT = -4, diff --git a/repos/base-nova/src/core/platform.cc b/repos/base-nova/src/core/platform.cc index 5a9beb7c42..bb8e516350 100644 --- a/repos/base-nova/src/core/platform.cc +++ b/repos/base-nova/src/core/platform.cc @@ -622,6 +622,7 @@ Platform::Platform() if (mem_desc->type == Hip::Mem_desc::ACPI_RSDT) continue; if (mem_desc->type == Hip::Mem_desc::ACPI_XSDT) continue; if (mem_desc->type == Hip::Mem_desc::FRAMEBUFFER) continue; + if (mem_desc->type == Hip::Mem_desc::EFI_SYSTEM_TABLE) continue; Hip::Mem_desc * mem_d = (Hip::Mem_desc *)mem_desc_base; for (unsigned j = 0; j < num_mem_desc; j++, mem_d++) { @@ -629,6 +630,7 @@ Platform::Platform() if (mem_d->type == Hip::Mem_desc::ACPI_RSDT) continue; if (mem_d->type == Hip::Mem_desc::ACPI_XSDT) continue; if (mem_d->type == Hip::Mem_desc::FRAMEBUFFER) continue; + if (mem_d->type == Hip::Mem_desc::EFI_SYSTEM_TABLE) continue; if (mem_d == mem_desc) continue; /* if regions are disjunct all is fine */ @@ -649,11 +651,13 @@ Platform::Platform() * From now on, it is save to use the core allocators... */ + uint64_t efi_sys_tab_phy = 0UL; uint64_t rsdt = 0UL; uint64_t xsdt = 0UL; mem_desc = (Hip::Mem_desc *)mem_desc_base; for (unsigned i = 0; i < num_mem_desc; i++, mem_desc++) { + if (mem_desc->type == Hip::Mem_desc::EFI_SYSTEM_TABLE) efi_sys_tab_phy = mem_desc->addr; if (mem_desc->type == Hip::Mem_desc::ACPI_RSDT) rsdt = mem_desc->addr; if (mem_desc->type == Hip::Mem_desc::ACPI_XSDT) xsdt = mem_desc->addr; if (mem_desc->type != Hip::Mem_desc::MULTIBOOT_MODULE) continue; @@ -685,6 +689,11 @@ Platform::Platform() "platform_info", [&] () { xml.node("kernel", [&] () { xml.attribute("name", "nova"); }); + if (efi_sys_tab_phy) { + xml.node("efi-system-table", [&] () { + xml.attribute("address", String<32>(Hex(efi_sys_tab_phy))); + }); + } xml.node("acpi", [&] () { xml.attribute("revision", 2); /* XXX */