diff --git a/hbvm/src/main.rs b/hbvm/src/main.rs index 05d23c7..f5cc613 100644 --- a/hbvm/src/main.rs +++ b/hbvm/src/main.rs @@ -1,3 +1,5 @@ +use hbvm::softpaging::paging::PageTable; + use { hbbytecode::valider::validate, hbvm::{ @@ -61,7 +63,7 @@ impl HandlePageFault for TestTrapHandler { fn page_fault( &mut self, _: MemoryAccessReason, - //_: &mut Memory, + _: &mut PageTable, _: u64, _: PageSize, _: *mut u8, diff --git a/hbvm/src/softpaging/mod.rs b/hbvm/src/softpaging/mod.rs index 2ec72e5..96005a4 100644 --- a/hbvm/src/softpaging/mod.rs +++ b/hbvm/src/softpaging/mod.rs @@ -98,7 +98,13 @@ impl SoftPagedMem { // No page found Some(Err(AddrPageLookupError { addr, size })) => { // Attempt to execute page fault handler - if self.pf_handler.page_fault(reason, addr, size, dst) { + if self.pf_handler.page_fault( + reason, + unsafe { &mut *self.root_pt }, + addr, + size, + dst, + ) { // Shift the splitter address pspl.bump(size); @@ -465,7 +471,7 @@ pub trait HandlePageFault { fn page_fault( &mut self, reason: MemoryAccessReason, - // memory: &mut SoftPagedMem, TODO: Make work + pagetable: &mut PageTable, vaddr: u64, size: PageSize, dataptr: *mut u8,