1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 19:07:35 +00:00

Kernel: Rename SystemRegistrar => SysFSComponentRegistry

This commit is contained in:
Andreas Kling 2021-07-11 01:05:26 +02:00
parent ea8578bf11
commit 27244eb0ee
7 changed files with 19 additions and 19 deletions

View file

@ -63,11 +63,11 @@ UNMAP_AFTER_INIT ExposedComponent::ExposedComponent(String name, PhysicalAddress
UNMAP_AFTER_INIT void ExposedFolder::initialize() UNMAP_AFTER_INIT void ExposedFolder::initialize()
{ {
auto acpi_folder = adopt_ref(*new (nothrow) ExposedFolder()); auto acpi_folder = adopt_ref(*new (nothrow) ExposedFolder());
SystemRegistrar::the().register_new_component(acpi_folder); SysFSComponentRegistry::the().register_new_component(acpi_folder);
} }
UNMAP_AFTER_INIT ExposedFolder::ExposedFolder() UNMAP_AFTER_INIT ExposedFolder::ExposedFolder()
: SystemExposedFolder("acpi", SystemRegistrar::the().root_folder()) : SystemExposedFolder("acpi", SysFSComponentRegistry::the().root_folder())
{ {
NonnullRefPtrVector<SystemExposedComponent> components; NonnullRefPtrVector<SystemExposedComponent> components;
size_t ssdt_count = 0; size_t ssdt_count = 0;

View file

@ -96,7 +96,7 @@ UNMAP_AFTER_INIT void BIOSExposedFolder::set_dmi_32_bit_entry_initialization_val
UNMAP_AFTER_INIT void BIOSExposedFolder::initialize() UNMAP_AFTER_INIT void BIOSExposedFolder::initialize()
{ {
auto bios_folder = adopt_ref(*new (nothrow) BIOSExposedFolder()); auto bios_folder = adopt_ref(*new (nothrow) BIOSExposedFolder());
SystemRegistrar::the().register_new_component(bios_folder); SysFSComponentRegistry::the().register_new_component(bios_folder);
bios_folder->create_components(); bios_folder->create_components();
} }
@ -135,7 +135,7 @@ OwnPtr<KBuffer> BIOSExposedFolder::smbios_structure_table() const
} }
UNMAP_AFTER_INIT BIOSExposedFolder::BIOSExposedFolder() UNMAP_AFTER_INIT BIOSExposedFolder::BIOSExposedFolder()
: SystemExposedFolder("bios", SystemRegistrar::the().root_folder()) : SystemExposedFolder("bios", SysFSComponentRegistry::the().root_folder())
{ {
auto entry_32bit = find_dmi_entry32bit_point(); auto entry_32bit = find_dmi_entry32bit_point();
m_dmi_entry_point = entry_32bit.value(); m_dmi_entry_point = entry_32bit.value();

View file

@ -389,11 +389,11 @@ UNMAP_AFTER_INIT ExposedDeviceFolder::ExposedDeviceFolder(const SystemExposedFol
UNMAP_AFTER_INIT void BusExposedFolder::initialize() UNMAP_AFTER_INIT void BusExposedFolder::initialize()
{ {
auto pci_folder = adopt_ref(*new (nothrow) BusExposedFolder()); auto pci_folder = adopt_ref(*new (nothrow) BusExposedFolder());
SystemRegistrar::the().register_new_component(pci_folder); SysFSComponentRegistry::the().register_new_component(pci_folder);
} }
UNMAP_AFTER_INIT BusExposedFolder::BusExposedFolder() UNMAP_AFTER_INIT BusExposedFolder::BusExposedFolder()
: SystemExposedFolder("pci", SystemRegistrar::the().root_folder()) : SystemExposedFolder("pci", SysFSComponentRegistry::the().root_folder())
{ {
PCI::enumerate([&](const Address& address, ID) { PCI::enumerate([&](const Address& address, ID) {
auto pci_device = PCI::ExposedDeviceFolder::create(*this, address); auto pci_device = PCI::ExposedDeviceFolder::create(*this, address);

View file

@ -12,25 +12,25 @@
namespace Kernel { namespace Kernel {
static AK::Singleton<SystemRegistrar> s_the; static AK::Singleton<SysFSComponentRegistry> s_the;
SystemRegistrar& SystemRegistrar::the() SysFSComponentRegistry& SysFSComponentRegistry::the()
{ {
return *s_the; return *s_the;
} }
UNMAP_AFTER_INIT void SystemRegistrar::initialize() UNMAP_AFTER_INIT void SysFSComponentRegistry::initialize()
{ {
VERIFY(!s_the.is_initialized()); VERIFY(!s_the.is_initialized());
s_the.ensure_instance(); s_the.ensure_instance();
} }
UNMAP_AFTER_INIT SystemRegistrar::SystemRegistrar() UNMAP_AFTER_INIT SysFSComponentRegistry::SysFSComponentRegistry()
: m_root_folder(SysFSRootFolder::create()) : m_root_folder(SysFSRootFolder::create())
{ {
} }
UNMAP_AFTER_INIT void SystemRegistrar::register_new_component(SystemExposedComponent& component) UNMAP_AFTER_INIT void SysFSComponentRegistry::register_new_component(SystemExposedComponent& component)
{ {
Locker locker(m_lock); Locker locker(m_lock);
m_root_folder->m_components.append(component); m_root_folder->m_components.append(component);
@ -43,7 +43,7 @@ NonnullRefPtr<SysFSRootFolder> SysFSRootFolder::create()
KResult SysFSRootFolder::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const KResult SysFSRootFolder::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
{ {
Locker locker(SystemRegistrar::the().m_lock); Locker locker(SysFSComponentRegistry::the().m_lock);
callback({ ".", { fsid, component_index() }, 0 }); callback({ ".", { fsid, component_index() }, 0 });
callback({ "..", { fsid, 0 }, 0 }); callback({ "..", { fsid, 0 }, 0 });
@ -65,7 +65,7 @@ NonnullRefPtr<SysFS> SysFS::create()
} }
SysFS::SysFS() SysFS::SysFS()
: m_root_inode(SystemRegistrar::the().m_root_folder->to_inode(*this)) : m_root_inode(SysFSComponentRegistry::the().m_root_folder->to_inode(*this))
{ {
Locker locker(m_lock); Locker locker(m_lock);
} }

View file

@ -22,7 +22,7 @@ class SysFSInode;
class SysFSDirectoryInode; class SysFSDirectoryInode;
class SysFSRootFolder final : public SystemExposedFolder { class SysFSRootFolder final : public SystemExposedFolder {
friend class SystemRegistrar; friend class SysFSComponentRegistry;
public: public:
static NonnullRefPtr<SysFSRootFolder> create(); static NonnullRefPtr<SysFSRootFolder> create();
@ -32,18 +32,18 @@ private:
SysFSRootFolder(); SysFSRootFolder();
}; };
class SystemRegistrar { class SysFSComponentRegistry {
friend class SysFS; friend class SysFS;
friend class SystemExposedComponent; friend class SystemExposedComponent;
friend class SystemExposedFolder; friend class SystemExposedFolder;
friend class SysFSRootFolder; friend class SysFSRootFolder;
public: public:
static SystemRegistrar& the(); static SysFSComponentRegistry& the();
static void initialize(); static void initialize();
SystemRegistrar(); SysFSComponentRegistry();
void register_new_component(SystemExposedComponent&); void register_new_component(SystemExposedComponent&);
NonnullRefPtr<SystemExposedFolder> root_folder() { return m_root_folder; } NonnullRefPtr<SystemExposedFolder> root_folder() { return m_root_folder; }

View file

@ -28,7 +28,7 @@ SystemExposedComponent::SystemExposedComponent(StringView name)
KResult SystemExposedFolder::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const KResult SystemExposedFolder::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
{ {
Locker locker(SystemRegistrar::the().m_lock); Locker locker(SysFSComponentRegistry::the().m_lock);
VERIFY(m_parent_folder); VERIFY(m_parent_folder);
callback({ ".", { fsid, component_index() }, 0 }); callback({ ".", { fsid, component_index() }, 0 });
callback({ "..", { fsid, m_parent_folder->component_index() }, 0 }); callback({ "..", { fsid, m_parent_folder->component_index() }, 0 });

View file

@ -143,7 +143,7 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init()
ACPI::initialize(); ACPI::initialize();
// Initialize the PCI Bus as early as possible, for early boot (PCI based) serial logging // Initialize the PCI Bus as early as possible, for early boot (PCI based) serial logging
SystemRegistrar::initialize(); SysFSComponentRegistry::initialize();
ProcFSComponentsRegistrar::initialize(); ProcFSComponentsRegistrar::initialize();
PCI::initialize(); PCI::initialize();
PCISerialDevice::detect(); PCISerialDevice::detect();