summaryrefslogtreecommitdiff
path: root/Kernel/PCI
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-28 16:19:50 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-28 17:05:14 +0200
commit9c856811b2ad18b933fc1d9d5b8a771893fa7d9c (patch)
tree264439a31fc3978ba85bae11d7d2d48bce5de03a /Kernel/PCI
parent8a417c311f3c3c13dc5353619051aac777c9f1df (diff)
downloadserenity-9c856811b2ad18b933fc1d9d5b8a771893fa7d9c.zip
Kernel: Add Region helpers for accessing underlying physical pages
Since a Region is basically a view into a potentially larger VMObject, it was always necessary to include the Region starting offset when accessing its underlying physical pages. Until now, you had to do that manually, but this patch adds a simple Region::physical_page() for read-only access and a physical_page_slot() when you want a mutable reference to the RefPtr<PhysicalPage> itself. A lot of code is simplified by making use of this.
Diffstat (limited to 'Kernel/PCI')
-rw-r--r--Kernel/PCI/MMIOAccess.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/PCI/MMIOAccess.cpp b/Kernel/PCI/MMIOAccess.cpp
index dfc8f96de7..9ade94ba4e 100644
--- a/Kernel/PCI/MMIOAccess.cpp
+++ b/Kernel/PCI/MMIOAccess.cpp
@@ -141,7 +141,7 @@ void MMIOAccess::map_device(Address address)
dbg() << "PCI: Mapping device @ pci (" << String::format("%w", address.seg()) << ":" << String::format("%b", address.bus()) << ":" << String::format("%b", address.slot()) << "." << String::format("%b", address.function()) << ")"
<< " V 0x" << String::format("%x", m_mmio_window_region->vaddr().get()) << " P 0x" << String::format("%x", device_physical_mmio_space.get());
#endif
- m_mmio_window_region->vmobject().physical_pages()[0] = PhysicalPage::create(device_physical_mmio_space, false, false);
+ m_mmio_window_region->physical_page_slot(0) = PhysicalPage::create(device_physical_mmio_space, false, false);
m_mmio_window_region->remap();
m_mapped_address = address;
}