mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
Kernel/SysFS: Split bulky SysFSPCI file into separate files
This commit is contained in:
parent
e488245234
commit
99bac4f34f
8 changed files with 138 additions and 74 deletions
31
Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/BusDirectory.cpp
Normal file
31
Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/BusDirectory.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Bus/PCI/API.h>
|
||||
#include <Kernel/Bus/PCI/Access.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/BusDirectory.h>
|
||||
#include <Kernel/FileSystem/SysFS/Subsystems/Bus/PCI/DeviceDirectory.h>
|
||||
#include <Kernel/Sections.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
UNMAP_AFTER_INIT void PCIBusSysFSDirectory::initialize()
|
||||
{
|
||||
auto pci_directory = adopt_ref(*new (nothrow) PCIBusSysFSDirectory());
|
||||
SysFSComponentRegistry::the().register_new_bus_directory(pci_directory);
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT PCIBusSysFSDirectory::PCIBusSysFSDirectory()
|
||||
: SysFSDirectory(SysFSComponentRegistry::the().buses_directory())
|
||||
{
|
||||
MUST(PCI::enumerate([&](PCI::DeviceIdentifier const& device_identifier) {
|
||||
auto pci_device = PCIDeviceSysFSDirectory::create(*this, device_identifier.address());
|
||||
m_components.append(pci_device);
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue