[vmbase] Move current exception handling helper functions to vmbase
The MemoryTracker in vmbase maps the MMIO memory range as lazy
device memory, which requires users of vmbase to handle
translation fault during the MMIO memory mapping. To avoid
duplicating the same fault handling code in each user, this cl
moves the fault handling helper functions to vmbase to streamline
the process.
This cl only moved the code from pvmfw to vmbase and added doc to
them. No functionality change in this cl.
Bug: 284462758
Test: m pvmfw_img
Change-Id: Ie3c8f2d871b4ebf13763e36f952b5b71f4660e77
diff --git a/vmbase/src/memory/mod.rs b/vmbase/src/memory/mod.rs
index 5e78565..898aa10 100644
--- a/vmbase/src/memory/mod.rs
+++ b/vmbase/src/memory/mod.rs
@@ -22,7 +22,10 @@
pub use error::MemoryTrackerError;
pub use page_table::PageTable;
-pub use shared::{alloc_shared, dealloc_shared, MemoryRange, MemoryTracker, MEMORY};
+pub use shared::{
+ alloc_shared, dealloc_shared, handle_permission_fault, handle_translation_fault, MemoryRange,
+ MemoryTracker, MEMORY,
+};
pub use util::{
flush, flushed_zeroize, min_dcache_line_size, page_4kb_of, phys_to_virt, virt_to_phys,
PAGE_SIZE, SIZE_128KB, SIZE_2MB, SIZE_4KB, SIZE_4MB, SIZE_64KB,