1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00

Kernel: Remove an unnecessary layer of indirection in the PCI code

The PCI access layer was composed of a bunch of virtual functions that
did nothing but call other virtual functions. The first layer was never
overridden so there was no need for them to be virtual.

This patch removes the indirection and moves logic from PCI::Access
down into the various PCI::get_foo() helpers that were the sole users.
This commit is contained in:
Andreas Kling 2020-04-08 16:56:36 +02:00
parent e5a20697da
commit e1709a0904
4 changed files with 62 additions and 87 deletions

View file

@ -163,7 +163,7 @@ E1000NetworkAdapter::E1000NetworkAdapter(PCI::Address address, u8 irq)
enable_bus_mastering(pci_address());
size_t mmio_base_size = PCI::get_BAR_Space_Size(pci_address(), 0);
size_t mmio_base_size = PCI::get_BAR_space_size(pci_address(), 0);
m_mmio_region = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR0(pci_address()))), PAGE_ROUND_UP(mmio_base_size), "E1000 MMIO", Region::Access::Read | Region::Access::Write, false, false);
m_mmio_base = m_mmio_region->vaddr();
m_use_mmio = true;