mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
Kernel: Move ACPI and BIOS code into the new Firmware directory
This will somwhat help unify them also under the same SysFS directory in the commit. Also, it feels much more like this change reflects the reality that both ACPI and the BIOS are part of the firmware on x86 computers.
This commit is contained in:
parent
a9ec98028b
commit
9132596b8e
21 changed files with 26 additions and 26 deletions
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, Liav A. <liavalb@hotmail.co.il>
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/ACPI/Parser.h>
|
||||
#include <Kernel/CommandLine.h>
|
||||
#include <Kernel/Memory/TypedMapping.h>
|
||||
#include <Kernel/Sections.h>
|
||||
|
||||
namespace Kernel::ACPI {
|
||||
|
||||
UNMAP_AFTER_INIT void initialize()
|
||||
{
|
||||
auto feature_level = kernel_command_line().acpi_feature_level();
|
||||
if (feature_level == AcpiFeatureLevel::Disabled)
|
||||
return;
|
||||
|
||||
auto rsdp = StaticParsing::find_rsdp();
|
||||
if (!rsdp.has_value())
|
||||
return;
|
||||
|
||||
auto facp = StaticParsing::find_table(rsdp.value(), "FACP");
|
||||
if (!facp.has_value())
|
||||
return;
|
||||
auto facp_table = Memory::map_typed<Structures::FADT>(facp.value());
|
||||
u8 irq_line = facp_table->sci_int;
|
||||
|
||||
Parser::must_initialize(rsdp.value(), facp.value(), irq_line);
|
||||
if (kernel_command_line().acpi_feature_level() == AcpiFeatureLevel::Enabled)
|
||||
Parser::the()->enable_aml_parsing();
|
||||
}
|
||||
|
||||
bool is_enabled()
|
||||
{
|
||||
return Parser::the();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue