1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

Kernel: Add convenience values to the Memory::Region::Access enum

Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite`
you can now say `Memory::Region::Access::ReadWrite`.
This commit is contained in:
Andreas Kling 2021-08-06 22:25:00 +02:00
parent 47bdd7c3a0
commit 2cd8b21974
38 changed files with 68 additions and 65 deletions

View file

@ -109,7 +109,7 @@ auto VirtIODevice::mapping_for_bar(u8 bar) -> MappedMMIO&
auto& mapping = m_mmio[bar];
if (!mapping.base) {
mapping.size = PCI::get_BAR_space_size(pci_address(), bar);
mapping.base = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR(pci_address(), bar))), Memory::page_round_up(mapping.size), "VirtIO MMIO", Memory::Region::Access::Read | Memory::Region::Access::Write, Memory::Region::Cacheable::No);
mapping.base = MM.allocate_kernel_region(PhysicalAddress(page_base_of(PCI::get_BAR(pci_address(), bar))), Memory::page_round_up(mapping.size), "VirtIO MMIO", Memory::Region::Access::ReadWrite, Memory::Region::Cacheable::No);
if (!mapping.base)
dbgln("{}: Failed to map bar {}", m_class_name, bar);
}