1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

Kernel/ACPI: Make most of StaticParsing methods to be platform-agnostic

Most of the ACPI static parsing methods (methods that can be called
without initializing a full AML parser) are not tied to any specific
platform or CPU architecture.

The only method that is platform-specific is the one that finds the RSDP
structure. Thus, each CPU architecture/platform needs to implement it.
This means that now aarch64 can implement its own method to find the
ACPI RSDP structure, which would be hooked into the rest of the ACPI
code elegantly, but for now I just added a FIXME and that method returns
empty value of Optional<PhysicalAddress>.
This commit is contained in:
Liav A 2023-06-09 22:50:11 +03:00 committed by Jelle Raaijmakers
parent be16a91aec
commit 428afca32b
11 changed files with 211 additions and 133 deletions

View file

@ -7,6 +7,7 @@
#include <Kernel/Boot/CommandLine.h>
#include <Kernel/Firmware/ACPI/Parser.h>
#include <Kernel/Firmware/ACPI/StaticParsing.h>
#include <Kernel/Memory/TypedMapping.h>
#include <Kernel/Sections.h>
@ -18,11 +19,11 @@ UNMAP_AFTER_INIT void initialize()
if (feature_level == AcpiFeatureLevel::Disabled)
return;
auto rsdp = StaticParsing::find_rsdp();
auto rsdp = MUST(StaticParsing::find_rsdp_in_platform_specific_memory_locations());
if (!rsdp.has_value())
return;
auto facp = StaticParsing::find_table(rsdp.value(), "FACP"sv);
auto facp = MUST(StaticParsing::find_table(rsdp.value(), "FACP"sv));
if (!facp.has_value())
return;
auto facp_table_or_error = Memory::map_typed<Structures::FADT>(facp.value());