
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.
67 lines
No EOL
1.6 KiB
C++
67 lines
No EOL
1.6 KiB
C++
#include <Kernel/ACPI/ACPIDynamicParser.h>
|
|
#include <Kernel/ACPI/ACPIParser.h>
|
|
|
|
void ACPIDynamicParser::initialize(ACPI_RAW::RSDPDescriptor20& rsdp)
|
|
{
|
|
if (!ACPIStaticParser::is_initialized()) {
|
|
new ACPIDynamicParser(rsdp);
|
|
}
|
|
}
|
|
void ACPIDynamicParser::initialize_without_rsdp()
|
|
{
|
|
if (!ACPIStaticParser::is_initialized()) {
|
|
new ACPIDynamicParser();
|
|
}
|
|
}
|
|
|
|
ACPIDynamicParser::ACPIDynamicParser()
|
|
: IRQHandler(9)
|
|
, ACPIStaticParser()
|
|
|
|
{
|
|
kprintf("ACPI: Dynamic Parsing Enabled, Can parse AML\n");
|
|
}
|
|
ACPIDynamicParser::ACPIDynamicParser(ACPI_RAW::RSDPDescriptor20& rsdp)
|
|
: IRQHandler(9)
|
|
, ACPIStaticParser(rsdp)
|
|
{
|
|
kprintf("ACPI: Dynamic Parsing Enabled, Can parse AML\n");
|
|
}
|
|
|
|
void ACPIDynamicParser::handle_irq()
|
|
{
|
|
// FIXME: Implement IRQ handling of ACPI signals!
|
|
ASSERT_NOT_REACHED();
|
|
}
|
|
|
|
void ACPIDynamicParser::enable_aml_interpretation()
|
|
{
|
|
// FIXME: Implement AML Interpretation
|
|
ASSERT_NOT_REACHED();
|
|
}
|
|
void ACPIDynamicParser::enable_aml_interpretation(File&)
|
|
{
|
|
// FIXME: Implement AML Interpretation
|
|
ASSERT_NOT_REACHED();
|
|
}
|
|
void ACPIDynamicParser::enable_aml_interpretation(u8*, u32)
|
|
{
|
|
// FIXME: Implement AML Interpretation
|
|
ASSERT_NOT_REACHED();
|
|
}
|
|
void ACPIDynamicParser::disable_aml_interpretation()
|
|
{
|
|
// FIXME: Implement AML Interpretation
|
|
ASSERT_NOT_REACHED();
|
|
}
|
|
void ACPIDynamicParser::do_acpi_shutdown()
|
|
{
|
|
// FIXME: Implement AML Interpretation to perform ACPI shutdown
|
|
ASSERT_NOT_REACHED();
|
|
}
|
|
|
|
void ACPIDynamicParser::build_namespace()
|
|
{
|
|
// FIXME: Implement AML Interpretation to build the ACPI namespace
|
|
ASSERT_NOT_REACHED();
|
|
} |