2021-09-11 11:19:33 +03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2022-04-22 12:46:19 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Registry.h>
|
2022-04-22 10:59:32 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/Firmware/BIOS/Directory.h>
|
2022-04-22 09:44:31 +03:00
|
|
|
#include <Kernel/FileSystem/SysFS/Subsystems/Firmware/Directory.h>
|
2021-09-11 11:19:33 +03:00
|
|
|
#include <Kernel/Firmware/ACPI/Parser.h>
|
|
|
|
|
#include <Kernel/Sections.h>
|
|
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
|
|
|
|
|
UNMAP_AFTER_INIT void FirmwareSysFSDirectory::initialize()
|
|
|
|
|
{
|
2022-08-19 20:53:40 +02:00
|
|
|
auto firmware_directory = adopt_lock_ref_if_nonnull(new (nothrow) FirmwareSysFSDirectory()).release_nonnull();
|
2021-09-11 11:19:33 +03:00
|
|
|
SysFSComponentRegistry::the().register_new_component(firmware_directory);
|
|
|
|
|
firmware_directory->create_components();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FirmwareSysFSDirectory::create_components()
|
|
|
|
|
{
|
2022-04-23 01:06:37 +03:00
|
|
|
MUST(m_child_components.with([&](auto& list) -> ErrorOr<void> {
|
|
|
|
|
list.append(BIOSSysFSDirectory::must_create(*this));
|
|
|
|
|
if (ACPI::is_enabled())
|
|
|
|
|
list.append(ACPI::ACPISysFSDirectory::must_create(*this));
|
|
|
|
|
return {};
|
|
|
|
|
}));
|
2021-09-11 11:19:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UNMAP_AFTER_INIT FirmwareSysFSDirectory::FirmwareSysFSDirectory()
|
2021-12-12 16:33:08 +02:00
|
|
|
: SysFSDirectory(SysFSComponentRegistry::the().root_directory())
|
2021-09-11 11:19:33 +03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|