Kernel/PCI: Convert PCI BAR number to a strong typed enum class

This commit is contained in:
Liav A 2022-09-02 19:59:08 +03:00 committed by Linus Groh
commit bb6f61ee5d
Notes: sideshowbarker 2024-07-17 06:47:31 +09:00
10 changed files with 26 additions and 17 deletions

View file

@ -208,7 +208,7 @@ UNMAP_AFTER_INIT bool E1000ENetworkAdapter::initialize()
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(), PCI::HeaderType0BaseRegister::BAR0);
auto region_or_error = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR0(pci_address()))), Memory::page_round_up(mmio_base_size).release_value_but_fixme_should_propagate_errors(), "E1000e MMIO"sv, Memory::Region::Access::ReadWrite, Memory::Region::Cacheable::No);
if (region_or_error.is_error())
return false;