vmbase_example: Map PCI & UART only
Only map what we acces, providing better coverage of the PCI DT node.
This removes the need for the hacky dodge of a BreakBeforeMakeViolation.
Bug: 377276983
Bug: 381400830
Test: atest vmbase_example.integration_test
Change-Id: Ia12b60b758799a62ee0df4eec99c64195b1452a9
diff --git a/guest/vmbase_example/src/pci.rs b/guest/vmbase_example/src/pci.rs
index 563f24a..379425d 100644
--- a/guest/vmbase_example/src/pci.rs
+++ b/guest/vmbase_example/src/pci.rs
@@ -120,6 +120,11 @@
MemoryRegion::new(pci_info.bar_range.start as usize, pci_info.bar_range.end as usize)
}
+/// Gets the PCI CAM memory region.
+pub fn get_cam_region(pci_info: &PciInfo) -> MemoryRegion {
+ MemoryRegion::new(pci_info.cam_range.start, pci_info.cam_range.end)
+}
+
struct HalImpl;
/// SAFETY: See the 'Implementation Safety' comments on methods below for how they fulfill the