1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-14 00:12:08 +00:00
serenity/Kernel/ACPI/ACPIParser.cpp
Liav A a9884fbbe5 Kernel: Remove problematic memory mapping methods
mmap() & mmap_region() methods are removed from ACPI & DMI components,
and we replace them with the new MM.allocate_kernel_region() helper.

Instead of doing a raw calculation for each VM address, from now on we
can use helper functions to do perform those calculations in a neat,
reusable and readable way.
2020-01-14 15:38:58 +01:00

74 lines
No EOL
1.6 KiB
C++

#include <Kernel/ACPI/ACPIParser.h>
static ACPIParser* s_acpi_parser;
ACPIParser& ACPIParser::the()
{
ASSERT(s_acpi_parser != nullptr);
return *s_acpi_parser;
}
void ACPIParser::initialize_limited()
{
if (!ACPIParser::is_initialized()) {
s_acpi_parser = new ACPIParser(false);
}
}
bool ACPIParser::is_initialized()
{
return (s_acpi_parser != nullptr);
}
ACPIParser::ACPIParser(bool usable)
{
if (usable) {
kprintf("ACPI: Setting up a functional parser\n");
} else {
kprintf("ACPI: Limited Initialization. Vital functions are disabled by a request\n");
}
s_acpi_parser = this;
}
ACPI_RAW::SDTHeader* ACPIParser::find_table(const char*)
{
kprintf("ACPI: Requested to search for a table, Abort!\n");
return nullptr;
}
void ACPIParser::do_acpi_reboot()
{
kprintf("ACPI: Cannot invoke reboot!\n");
ASSERT_NOT_REACHED();
}
void ACPIParser::do_acpi_shutdown()
{
kprintf("ACPI: Cannot invoke shutdown!\n");
ASSERT_NOT_REACHED();
}
void ACPIParser::enable_aml_interpretation()
{
kprintf("ACPI: No AML Interpretation Allowed\n");
ASSERT_NOT_REACHED();
}
void ACPIParser::enable_aml_interpretation(File&)
{
kprintf("ACPI: No AML Interpretation Allowed\n");
ASSERT_NOT_REACHED();
}
void ACPIParser::enable_aml_interpretation(u8*, u32)
{
kprintf("ACPI: No AML Interpretation Allowed\n");
ASSERT_NOT_REACHED();
}
void ACPIParser::disable_aml_interpretation()
{
kprintf("ACPI Limited: No AML Interpretation Allowed\n");
ASSERT_NOT_REACHED();
}
bool ACPIParser::is_operable()
{
return false;
}