mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
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.
This commit is contained in:
parent
e22d9dc360
commit
82bb08a15c
Notes:
sideshowbarker
2024-07-18 03:21:21 +09:00
Author: https://github.com/supercomputer7
Commit: 82bb08a15c
Pull-request: https://github.com/SerenityOS/serenity/pull/10187
Reviewed-by: https://github.com/awesomekling
14 changed files with 85 additions and 41 deletions
|
@ -15,12 +15,12 @@ static SerialDevice* s_the = nullptr;
|
|||
UNMAP_AFTER_INIT void PCISerialDevice::detect()
|
||||
{
|
||||
size_t current_device_minor = 68;
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::ID id) {
|
||||
PCI::enumerate([&](const PCI::Address& address, PCI::PhysicalID const& physical_id) {
|
||||
if (address.is_null())
|
||||
return;
|
||||
|
||||
for (auto& board_definition : board_definitions) {
|
||||
if (board_definition.device_id != id)
|
||||
if (board_definition.device_id != physical_id.id())
|
||||
continue;
|
||||
|
||||
auto bar_base = PCI::get_BAR(address, board_definition.pci_bar) & ~1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue