
ACPI subsystem includes 3 types of parsers that are created during runtime, each one capable of parsing ACPI tables at different level. ACPIParser is the most basic parser which is essentialy a parser that can't parse anything useful, due to a user request to disable ACPI support in a kernel boot parameter. ACPIStaticParser is a derived class from ACPIParser, which is able to parse only static data (e.g. FADT, HPET, MCFG and other tables), thus making it not able to parse AML (ACPI Machine Language) nor to support handling of hardware events and power management. This type of parser can be created with a kernel boot parameter. ACPIDynamicParser is a derived class from ACPIStaticParser, which includes all the capabilities of the latter, but *should* implement an AML interpretation, (by building the ACPI AML namespace) and handling power & hardware events. Currently the methods to support AML interpretation are not implemented. This type of parser is created automatically during runtime if the user didn't specify a boot parameter related to ACPI initialization. Also, adding strncmp function definition in StdLib.h, to be able to use it in ACPIStaticParser class.
33 lines
No EOL
998 B
C++
33 lines
No EOL
998 B
C++
#pragma once
|
|
|
|
#include <AK/RefPtr.h>
|
|
#include <Kernel/ACPI/ACPIStaticParser.h>
|
|
#include <Kernel/Devices/DiskDevice.h>
|
|
#include <Kernel/IRQHandler.h>
|
|
#include <Kernel/Lock.h>
|
|
#include <Kernel/VM/PhysicalAddress.h>
|
|
#include <Kernel/VM/PhysicalPage.h>
|
|
|
|
class ACPIDynamicParser final : public IRQHandler
|
|
, ACPIStaticParser {
|
|
public:
|
|
static void initialize(ACPI_RAW::RSDPDescriptor20& rsdp);
|
|
static void initialize_without_rsdp();
|
|
|
|
virtual void enable_aml_interpretation() override;
|
|
virtual void enable_aml_interpretation(File& dsdt_file) override;
|
|
virtual void enable_aml_interpretation(u8* physical_dsdt, u32 dsdt_payload_legnth) override;
|
|
virtual void disable_aml_interpretation() override;
|
|
virtual void do_acpi_shutdown() override;
|
|
|
|
protected:
|
|
ACPIDynamicParser();
|
|
explicit ACPIDynamicParser(ACPI_RAW::RSDPDescriptor20&);
|
|
|
|
private:
|
|
void build_namespace();
|
|
// ^IRQHandler
|
|
virtual void handle_irq() override;
|
|
|
|
OwnPtr<Region> m_acpi_namespace;
|
|
}; |