Skip to content

Commit

Permalink
Kernel/ACPI: Use the EFI-provided RSDP address, if present
Browse files Browse the repository at this point in the history
The EFIPrekernel will set `acpi_rsdp_paddr` to the RSDP address found
in the configuration table.
  • Loading branch information
spholz committed Jan 26, 2025
1 parent 2e5e8c1 commit 395ab9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Kernel/Firmware/ACPI/Initialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

#include <Kernel/Boot/BootInfo.h>
#include <Kernel/Boot/CommandLine.h>
#include <Kernel/Firmware/ACPI/Parser.h>
#include <Kernel/Firmware/ACPI/StaticParsing.h>
Expand All @@ -19,7 +20,12 @@ UNMAP_AFTER_INIT void initialize()
if (feature_level == AcpiFeatureLevel::Disabled)
return;

auto rsdp = MUST(StaticParsing::find_rsdp_in_platform_specific_memory_locations());
Optional<PhysicalAddress> rsdp;
if (!g_boot_info.acpi_rsdp_paddr.is_null())
rsdp = g_boot_info.acpi_rsdp_paddr;
else
MUST(StaticParsing::find_rsdp_in_platform_specific_memory_locations());

if (!rsdp.has_value())
return;

Expand Down
2 changes: 2 additions & 0 deletions Kernel/Prekernel/Prekernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ struct BootInfo {
PhysicalAddress flattened_devicetree_paddr { 0 };
size_t flattened_devicetree_size { 0 };

PhysicalAddress acpi_rsdp_paddr { 0 };

size_t physical_to_virtual_offset { 0 };
FlatPtr kernel_mapping_base { 0 };
FlatPtr kernel_load_base { 0 };
Expand Down

0 comments on commit 395ab9a

Please sign in to comment.