mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
Kernel/PCI: Convert PCI BAR number to a strong typed enum class
This commit is contained in:
parent
f510c0ba04
commit
bb6f61ee5d
10 changed files with 26 additions and 17 deletions
|
@ -199,7 +199,7 @@ UNMAP_AFTER_INIT bool E1000NetworkAdapter::initialize()
|
|||
|
||||
m_io_base = IOAddress(PCI::get_BAR1(pci_address()) & ~1);
|
||||
|
||||
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(), "E1000 MMIO"sv, Memory::Region::Access::ReadWrite, Memory::Region::Cacheable::No);
|
||||
if (region_or_error.is_error())
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue