mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
Kernel: Introduce the ACPI subsystem
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.
This commit is contained in:
parent
331f37d1a8
commit
1e1a6a57ed
8 changed files with 894 additions and 0 deletions
33
Kernel/ACPI/ACPIParser.h
Normal file
33
Kernel/ACPI/ACPIParser.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#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);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue