mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 07:47:34 +00:00
Kernel: Remove PCI information node from ProcFS
The SystemMonitor program was the last client to utilize this node, and now it is not using this node anymore, we can simply remove this for good.
This commit is contained in:
parent
889b9d029e
commit
38bf7863d0
3 changed files with 0 additions and 53 deletions
|
@ -96,7 +96,6 @@ UNMAP_AFTER_INIT bool Access::find_and_register_pci_host_bridges_from_acpi_mcfg_
|
||||||
UNMAP_AFTER_INIT bool Access::initialize_for_multiple_pci_domains(PhysicalAddress mcfg_table)
|
UNMAP_AFTER_INIT bool Access::initialize_for_multiple_pci_domains(PhysicalAddress mcfg_table)
|
||||||
{
|
{
|
||||||
VERIFY(!Access::is_initialized());
|
VERIFY(!Access::is_initialized());
|
||||||
ProcFSComponentRegistry::the().root_directory().add_pci_node({});
|
|
||||||
auto* access = new Access();
|
auto* access = new Access();
|
||||||
if (!access->find_and_register_pci_host_bridges_from_acpi_mcfg_table(mcfg_table))
|
if (!access->find_and_register_pci_host_bridges_from_acpi_mcfg_table(mcfg_table))
|
||||||
return false;
|
return false;
|
||||||
|
@ -108,7 +107,6 @@ UNMAP_AFTER_INIT bool Access::initialize_for_multiple_pci_domains(PhysicalAddres
|
||||||
UNMAP_AFTER_INIT bool Access::initialize_for_one_pci_domain()
|
UNMAP_AFTER_INIT bool Access::initialize_for_one_pci_domain()
|
||||||
{
|
{
|
||||||
VERIFY(!Access::is_initialized());
|
VERIFY(!Access::is_initialized());
|
||||||
ProcFSComponentRegistry::the().root_directory().add_pci_node({});
|
|
||||||
auto* access = new Access();
|
auto* access = new Access();
|
||||||
auto host_bridge = HostBridge::must_create_with_io_access();
|
auto host_bridge = HostBridge::must_create_with_io_access();
|
||||||
access->add_host_controller(move(host_bridge));
|
access->add_host_controller(move(host_bridge));
|
||||||
|
|
|
@ -728,43 +728,6 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: Remove this after we enumerate the SysFS from lspci and SystemMonitor
|
|
||||||
class ProcFSPCI final : public ProcFSGlobalInformation {
|
|
||||||
public:
|
|
||||||
static NonnullRefPtr<ProcFSPCI> must_create();
|
|
||||||
|
|
||||||
private:
|
|
||||||
ProcFSPCI();
|
|
||||||
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override
|
|
||||||
{
|
|
||||||
auto array = TRY(JsonArraySerializer<>::try_create(builder));
|
|
||||||
ErrorOr<void> result; // FIXME: Make this nicer
|
|
||||||
TRY(PCI::enumerate([&array, &result](PCI::DeviceIdentifier const& device_identifier) {
|
|
||||||
if (result.is_error())
|
|
||||||
return;
|
|
||||||
result = ([&]() -> ErrorOr<void> {
|
|
||||||
auto obj = TRY(array.add_object());
|
|
||||||
TRY(obj.add("domain"sv, device_identifier.address().domain()));
|
|
||||||
TRY(obj.add("bus"sv, device_identifier.address().bus()));
|
|
||||||
TRY(obj.add("device"sv, device_identifier.address().device()));
|
|
||||||
TRY(obj.add("function"sv, device_identifier.address().function()));
|
|
||||||
TRY(obj.add("vendor_id"sv, device_identifier.hardware_id().vendor_id));
|
|
||||||
TRY(obj.add("device_id"sv, device_identifier.hardware_id().device_id));
|
|
||||||
TRY(obj.add("revision_id"sv, device_identifier.revision_id().value()));
|
|
||||||
TRY(obj.add("subclass"sv, device_identifier.subclass_code().value()));
|
|
||||||
TRY(obj.add("class"sv, device_identifier.class_code().value()));
|
|
||||||
TRY(obj.add("subsystem_id"sv, device_identifier.subsystem_id().value()));
|
|
||||||
TRY(obj.add("subsystem_vendor_id"sv, device_identifier.subsystem_vendor_id().value()));
|
|
||||||
TRY(obj.finish());
|
|
||||||
return {};
|
|
||||||
})();
|
|
||||||
}));
|
|
||||||
TRY(result);
|
|
||||||
TRY(array.finish());
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProcFSDevices final : public ProcFSGlobalInformation {
|
class ProcFSDevices final : public ProcFSGlobalInformation {
|
||||||
public:
|
public:
|
||||||
static NonnullRefPtr<ProcFSDevices> must_create();
|
static NonnullRefPtr<ProcFSDevices> must_create();
|
||||||
|
@ -901,10 +864,6 @@ UNMAP_AFTER_INIT NonnullRefPtr<ProcFSKeymap> ProcFSKeymap::must_create()
|
||||||
{
|
{
|
||||||
return adopt_ref_if_nonnull(new (nothrow) ProcFSKeymap).release_nonnull();
|
return adopt_ref_if_nonnull(new (nothrow) ProcFSKeymap).release_nonnull();
|
||||||
}
|
}
|
||||||
UNMAP_AFTER_INIT NonnullRefPtr<ProcFSPCI> ProcFSPCI::must_create()
|
|
||||||
{
|
|
||||||
return adopt_ref_if_nonnull(new (nothrow) ProcFSPCI).release_nonnull();
|
|
||||||
}
|
|
||||||
UNMAP_AFTER_INIT NonnullRefPtr<ProcFSDevices> ProcFSDevices::must_create()
|
UNMAP_AFTER_INIT NonnullRefPtr<ProcFSDevices> ProcFSDevices::must_create()
|
||||||
{
|
{
|
||||||
return adopt_ref_if_nonnull(new (nothrow) ProcFSDevices).release_nonnull();
|
return adopt_ref_if_nonnull(new (nothrow) ProcFSDevices).release_nonnull();
|
||||||
|
@ -967,10 +926,6 @@ UNMAP_AFTER_INIT ProcFSKeymap::ProcFSKeymap()
|
||||||
: ProcFSGlobalInformation("keymap"sv)
|
: ProcFSGlobalInformation("keymap"sv)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
UNMAP_AFTER_INIT ProcFSPCI::ProcFSPCI()
|
|
||||||
: ProcFSGlobalInformation("pci"sv)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
UNMAP_AFTER_INIT ProcFSDevices::ProcFSDevices()
|
UNMAP_AFTER_INIT ProcFSDevices::ProcFSDevices()
|
||||||
: ProcFSGlobalInformation("devices"sv)
|
: ProcFSGlobalInformation("devices"sv)
|
||||||
{
|
{
|
||||||
|
@ -1011,11 +966,6 @@ UNMAP_AFTER_INIT ProcFSSystemDirectory::ProcFSSystemDirectory(ProcFSRootDirector
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void ProcFSRootDirectory::add_pci_node(Badge<PCI::Access>)
|
|
||||||
{
|
|
||||||
m_components.append(ProcFSPCI::must_create());
|
|
||||||
}
|
|
||||||
|
|
||||||
UNMAP_AFTER_INIT NonnullRefPtr<ProcFSRootDirectory> ProcFSRootDirectory::must_create()
|
UNMAP_AFTER_INIT NonnullRefPtr<ProcFSRootDirectory> ProcFSRootDirectory::must_create()
|
||||||
{
|
{
|
||||||
auto directory = adopt_ref(*new (nothrow) ProcFSRootDirectory);
|
auto directory = adopt_ref(*new (nothrow) ProcFSRootDirectory);
|
||||||
|
|
|
@ -152,7 +152,6 @@ public:
|
||||||
virtual ErrorOr<NonnullRefPtr<ProcFSExposedComponent>> lookup(StringView name) override;
|
virtual ErrorOr<NonnullRefPtr<ProcFSExposedComponent>> lookup(StringView name) override;
|
||||||
static NonnullRefPtr<ProcFSRootDirectory> must_create();
|
static NonnullRefPtr<ProcFSRootDirectory> must_create();
|
||||||
|
|
||||||
void add_pci_node(Badge<PCI::Access>);
|
|
||||||
virtual ~ProcFSRootDirectory();
|
virtual ~ProcFSRootDirectory();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue