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
commit 428afca32b
Notes: sideshowbarker 2024-07-17 02:21:14 +09:00
11 changed files with 211 additions and 133 deletions

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/Optional.h>
#include <AK/Types.h>
#include <Kernel/Memory/PhysicalAddress.h>
namespace Kernel::ACPI::StaticParsing {
ErrorOr<Optional<PhysicalAddress>> find_table(PhysicalAddress rsdp, StringView signature);
ErrorOr<Optional<PhysicalAddress>> search_table_in_xsdt(PhysicalAddress xsdt, StringView signature);
ErrorOr<Optional<PhysicalAddress>> search_table_in_rsdt(PhysicalAddress rsdt, StringView signature);
// NOTE: This function is implemented for each CPU architecture in a subdirectory
// under the Kernel/Arch directory.
ErrorOr<Optional<PhysicalAddress>> find_rsdp_in_platform_specific_memory_locations();
}