mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Kernel: Rename SystemExposedFolder => SysFSDirectory
"Folder" is a GUI concept, let's call this "Directory". Also, "System" is completely generic, so let's be more specific and call this "SysFS..."
This commit is contained in:
parent
517170a986
commit
60a7a9d523
10 changed files with 25 additions and 25 deletions
|
@ -67,7 +67,7 @@ UNMAP_AFTER_INIT void ExposedFolder::initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT ExposedFolder::ExposedFolder()
|
UNMAP_AFTER_INIT ExposedFolder::ExposedFolder()
|
||||||
: SystemExposedFolder("acpi", SysFSComponentRegistry::the().root_folder())
|
: SysFSDirectory("acpi", SysFSComponentRegistry::the().root_folder())
|
||||||
{
|
{
|
||||||
NonnullRefPtrVector<SysFSComponent> components;
|
NonnullRefPtrVector<SysFSComponent> components;
|
||||||
size_t ssdt_count = 0;
|
size_t ssdt_count = 0;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
namespace ACPI {
|
namespace ACPI {
|
||||||
|
|
||||||
class ExposedFolder : public SystemExposedFolder {
|
class ExposedFolder : public SysFSDirectory {
|
||||||
public:
|
public:
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,7 @@ OwnPtr<KBuffer> BIOSExposedFolder::smbios_structure_table() const
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT BIOSExposedFolder::BIOSExposedFolder()
|
UNMAP_AFTER_INIT BIOSExposedFolder::BIOSExposedFolder()
|
||||||
: SystemExposedFolder("bios", SysFSComponentRegistry::the().root_folder())
|
: SysFSDirectory("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();
|
||||||
|
|
|
@ -92,7 +92,7 @@ private:
|
||||||
size_t m_smbios_structure_table_length;
|
size_t m_smbios_structure_table_length;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BIOSExposedFolder : public SystemExposedFolder {
|
class BIOSExposedFolder : public SysFSDirectory {
|
||||||
public:
|
public:
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
|
|
|
@ -368,13 +368,13 @@ void Capability::write32(u32 field, u32 value)
|
||||||
PCI::write32(m_address, m_ptr + field, value);
|
PCI::write32(m_address, m_ptr + field, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT NonnullRefPtr<ExposedDeviceFolder> ExposedDeviceFolder::create(const SystemExposedFolder& parent_folder, Address address)
|
UNMAP_AFTER_INIT NonnullRefPtr<ExposedDeviceFolder> ExposedDeviceFolder::create(const SysFSDirectory& parent_folder, Address address)
|
||||||
{
|
{
|
||||||
return adopt_ref(*new (nothrow) ExposedDeviceFolder(parent_folder, address));
|
return adopt_ref(*new (nothrow) ExposedDeviceFolder(parent_folder, address));
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT ExposedDeviceFolder::ExposedDeviceFolder(const SystemExposedFolder& parent_folder, Address address)
|
UNMAP_AFTER_INIT ExposedDeviceFolder::ExposedDeviceFolder(const SysFSDirectory& parent_folder, Address address)
|
||||||
: SystemExposedFolder(String::formatted("{:04x}:{:04x}:{:02x}.{}", address.seg(), address.bus(), address.device(), address.function()), parent_folder)
|
: SysFSDirectory(String::formatted("{:04x}:{:04x}:{:02x}.{}", address.seg(), address.bus(), address.device(), address.function()), parent_folder)
|
||||||
{
|
{
|
||||||
m_components.append(ExposedAttribute::create("vendor", *this, PCI_VENDOR_ID, 2));
|
m_components.append(ExposedAttribute::create("vendor", *this, PCI_VENDOR_ID, 2));
|
||||||
m_components.append(ExposedAttribute::create("device_id", *this, PCI_DEVICE_ID, 2));
|
m_components.append(ExposedAttribute::create("device_id", *this, PCI_DEVICE_ID, 2));
|
||||||
|
@ -393,7 +393,7 @@ UNMAP_AFTER_INIT void BusExposedFolder::initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT BusExposedFolder::BusExposedFolder()
|
UNMAP_AFTER_INIT BusExposedFolder::BusExposedFolder()
|
||||||
: SystemExposedFolder("pci", SysFSComponentRegistry::the().root_folder())
|
: SysFSDirectory("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);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
namespace Kernel::PCI {
|
namespace Kernel::PCI {
|
||||||
|
|
||||||
class BusExposedFolder final : public SystemExposedFolder {
|
class BusExposedFolder final : public SysFSDirectory {
|
||||||
public:
|
public:
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ private:
|
||||||
BusExposedFolder();
|
BusExposedFolder();
|
||||||
};
|
};
|
||||||
|
|
||||||
class ExposedDeviceFolder final : public SystemExposedFolder {
|
class ExposedDeviceFolder final : public SysFSDirectory {
|
||||||
public:
|
public:
|
||||||
static NonnullRefPtr<ExposedDeviceFolder> create(const SystemExposedFolder&, Address);
|
static NonnullRefPtr<ExposedDeviceFolder> create(const SysFSDirectory&, Address);
|
||||||
const Address& address() const { return m_address; }
|
const Address& address() const { return m_address; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExposedDeviceFolder(const SystemExposedFolder&, Address);
|
ExposedDeviceFolder(const SysFSDirectory&, Address);
|
||||||
|
|
||||||
Address m_address;
|
Address m_address;
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@ KResult SysFSRootFolder::traverse_as_directory(unsigned fsid, Function<bool(File
|
||||||
}
|
}
|
||||||
|
|
||||||
SysFSRootFolder::SysFSRootFolder()
|
SysFSRootFolder::SysFSRootFolder()
|
||||||
: SystemExposedFolder(".")
|
: SysFSDirectory(".")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class SysFS;
|
||||||
class SysFSInode;
|
class SysFSInode;
|
||||||
class SysFSDirectoryInode;
|
class SysFSDirectoryInode;
|
||||||
|
|
||||||
class SysFSRootFolder final : public SystemExposedFolder {
|
class SysFSRootFolder final : public SysFSDirectory {
|
||||||
friend class SysFSComponentRegistry;
|
friend class SysFSComponentRegistry;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -35,7 +35,7 @@ private:
|
||||||
class SysFSComponentRegistry {
|
class SysFSComponentRegistry {
|
||||||
friend class SysFS;
|
friend class SysFS;
|
||||||
friend class SysFSComponent;
|
friend class SysFSComponent;
|
||||||
friend class SystemExposedFolder;
|
friend class SysFSDirectory;
|
||||||
friend class SysFSRootFolder;
|
friend class SysFSRootFolder;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -46,7 +46,7 @@ public:
|
||||||
SysFSComponentRegistry();
|
SysFSComponentRegistry();
|
||||||
void register_new_component(SysFSComponent&);
|
void register_new_component(SysFSComponent&);
|
||||||
|
|
||||||
NonnullRefPtr<SystemExposedFolder> root_folder() { return m_root_folder; }
|
NonnullRefPtr<SysFSDirectory> root_folder() { return m_root_folder; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Lock m_lock;
|
Lock m_lock;
|
||||||
|
|
|
@ -26,7 +26,7 @@ SysFSComponent::SysFSComponent(StringView name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
KResult SystemExposedFolder::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
KResult SysFSDirectory::traverse_as_directory(unsigned fsid, Function<bool(FileSystem::DirectoryEntryView const&)> callback) const
|
||||||
{
|
{
|
||||||
Locker locker(SysFSComponentRegistry::the().m_lock);
|
Locker locker(SysFSComponentRegistry::the().m_lock);
|
||||||
VERIFY(m_parent_folder);
|
VERIFY(m_parent_folder);
|
||||||
|
@ -40,7 +40,7 @@ KResult SystemExposedFolder::traverse_as_directory(unsigned fsid, Function<bool(
|
||||||
return KSuccess;
|
return KSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<SysFSComponent> SystemExposedFolder::lookup(StringView name)
|
RefPtr<SysFSComponent> SysFSDirectory::lookup(StringView name)
|
||||||
{
|
{
|
||||||
for (auto& component : m_components) {
|
for (auto& component : m_components) {
|
||||||
if (component.name() == name) {
|
if (component.name() == name) {
|
||||||
|
@ -50,18 +50,18 @@ RefPtr<SysFSComponent> SystemExposedFolder::lookup(StringView name)
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemExposedFolder::SystemExposedFolder(StringView name)
|
SysFSDirectory::SysFSDirectory(StringView name)
|
||||||
: SysFSComponent(name)
|
: SysFSComponent(name)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemExposedFolder::SystemExposedFolder(StringView name, SystemExposedFolder const& parent_folder)
|
SysFSDirectory::SysFSDirectory(StringView name, SysFSDirectory const& parent_folder)
|
||||||
: SysFSComponent(name)
|
: SysFSComponent(name)
|
||||||
, m_parent_folder(parent_folder)
|
, m_parent_folder(parent_folder)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NonnullRefPtr<Inode> SystemExposedFolder::to_inode(SysFS const& sysfs_instance) const
|
NonnullRefPtr<Inode> SysFSDirectory::to_inode(SysFS const& sysfs_instance) const
|
||||||
{
|
{
|
||||||
return SysFSDirectoryInode::create(sysfs_instance, *this);
|
return SysFSDirectoryInode::create(sysfs_instance, *this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ private:
|
||||||
InodeIndex m_component_index {};
|
InodeIndex m_component_index {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class SystemExposedFolder : public SysFSComponent {
|
class SysFSDirectory : public SysFSComponent {
|
||||||
public:
|
public:
|
||||||
virtual KResultOr<size_t> entries_count() const override { return m_components.size(); };
|
virtual KResultOr<size_t> entries_count() const override { return m_components.size(); };
|
||||||
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
virtual KResult traverse_as_directory(unsigned, Function<bool(FileSystem::DirectoryEntryView const&)>) const override;
|
||||||
|
@ -53,10 +53,10 @@ public:
|
||||||
virtual NonnullRefPtr<Inode> to_inode(SysFS const& sysfs_instance) const override final;
|
virtual NonnullRefPtr<Inode> to_inode(SysFS const& sysfs_instance) const override final;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit SystemExposedFolder(StringView name);
|
explicit SysFSDirectory(StringView name);
|
||||||
SystemExposedFolder(StringView name, SystemExposedFolder const& parent_folder);
|
SysFSDirectory(StringView name, SysFSDirectory const& parent_folder);
|
||||||
NonnullRefPtrVector<SysFSComponent> m_components;
|
NonnullRefPtrVector<SysFSComponent> m_components;
|
||||||
RefPtr<SystemExposedFolder> m_parent_folder;
|
RefPtr<SysFSDirectory> m_parent_folder;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue