/* * Copyright (c) 2021, Liav A. * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include namespace Kernel { UNMAP_AFTER_INIT void FirmwareSysFSDirectory::initialize() { auto firmware_directory = adopt_lock_ref_if_nonnull(new (nothrow) FirmwareSysFSDirectory()).release_nonnull(); SysFSComponentRegistry::the().register_new_component(firmware_directory); firmware_directory->create_components(); } void FirmwareSysFSDirectory::create_components() { MUST(m_child_components.with([&](auto& list) -> ErrorOr { list.append(BIOSSysFSDirectory::must_create(*this)); if (ACPI::is_enabled()) list.append(ACPI::ACPISysFSDirectory::must_create(*this)); list.append(PowerStateSwitchNode::must_create(*this)); return {}; })); } UNMAP_AFTER_INIT FirmwareSysFSDirectory::FirmwareSysFSDirectory() : SysFSDirectory(SysFSComponentRegistry::the().root_directory()) { } }