
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
904 B
C++
33 lines
No EOL
904 B
C++
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <Kernel/ACPI/Definitions.h>
|
|
#include <Kernel/FileSystem/File.h>
|
|
#include <Kernel/VM/PhysicalAddress.h>
|
|
#include <Kernel/VM/Region.h>
|
|
#include <Kernel/VM/VirtualAddress.h>
|
|
|
|
class ACPIParser {
|
|
public:
|
|
static ACPIParser& the();
|
|
|
|
static bool is_initialized();
|
|
static void initialize_limited();
|
|
virtual ACPI_RAW::SDTHeader* find_table(const char* sig);
|
|
|
|
virtual void do_acpi_reboot();
|
|
virtual void do_acpi_shutdown();
|
|
|
|
virtual void enable_aml_interpretation();
|
|
virtual void enable_aml_interpretation(File&);
|
|
virtual void enable_aml_interpretation(u8*, u32);
|
|
virtual void disable_aml_interpretation();
|
|
virtual bool is_operable();
|
|
|
|
protected:
|
|
explicit ACPIParser(bool usable);
|
|
bool m_operable;
|
|
|
|
virtual void mmap(VirtualAddress, PhysicalAddress, u32);
|
|
virtual void mmap_region(Region&, PhysicalAddress);
|
|
}; |