diff options
author | Liav A <liavalb@gmail.com> | 2021-09-23 09:05:34 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-29 11:24:33 +0200 |
commit | 82bb08a15cbe447b5b0deeac16cccc22bf1c1c57 (patch) | |
tree | ecb5dc7c013c1f11516fb8c74561be10179fa7d2 /Kernel/Storage/StorageManagement.cpp | |
parent | e22d9dc360d123b5b3c847a9ec882da220dc8e66 (diff) | |
download | serenity-82bb08a15cbe447b5b0deeac16cccc22bf1c1c57.zip |
Kernel/PCI: Cache more details about PCI devices when enumerating them
There's no good reason to fetch these values each time we need them.
Diffstat (limited to 'Kernel/Storage/StorageManagement.cpp')
-rw-r--r-- | Kernel/Storage/StorageManagement.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/Storage/StorageManagement.cpp b/Kernel/Storage/StorageManagement.cpp index 6777a74fc6..711132a02d 100644 --- a/Kernel/Storage/StorageManagement.cpp +++ b/Kernel/Storage/StorageManagement.cpp @@ -44,14 +44,14 @@ UNMAP_AFTER_INIT void StorageManagement::enumerate_controllers(bool force_pio) VERIFY(m_controllers.is_empty()); if (!kernel_command_line().disable_physical_storage()) { if (kernel_command_line().is_ide_enabled()) { - PCI::enumerate([&](const PCI::Address& address, PCI::ID) { - if (PCI::get_class(address) == PCI_MASS_STORAGE_CLASS_ID && PCI::get_subclass(address) == PCI_IDE_CTRL_SUBCLASS_ID) { + PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) { + if (physical_id.class_code().value() == PCI_MASS_STORAGE_CLASS_ID && physical_id.subclass_code().value() == PCI_IDE_CTRL_SUBCLASS_ID) { m_controllers.append(IDEController::initialize(address, force_pio)); } }); } - PCI::enumerate([&](const PCI::Address& address, PCI::ID) { - if (PCI::get_class(address) == PCI_MASS_STORAGE_CLASS_ID && PCI::get_subclass(address) == PCI_SATA_CTRL_SUBCLASS_ID && PCI::get_programming_interface(address) == PCI_AHCI_IF_PROGIF) { + PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) { + if (physical_id.class_code().value() == PCI_MASS_STORAGE_CLASS_ID && physical_id.subclass_code().value() == PCI_SATA_CTRL_SUBCLASS_ID && physical_id.prog_if().value() == PCI_AHCI_IF_PROGIF) { m_controllers.append(AHCIController::initialize(address)); } }); |