Added inner memory access

pull/2/head
ondra05 2023-08-08 03:10:11 +02:00
parent 6dc03ac6c5
commit e560b361bc
No known key found for this signature in database
GPG Key ID: 0DA6D2BB2285E881
2 changed files with 11 additions and 3 deletions

View File

@ -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,

View File

@ -98,7 +98,13 @@ impl<PfHandler: HandlePageFault> SoftPagedMem<PfHandler> {
// 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<Self>, TODO: Make work
pagetable: &mut PageTable,
vaddr: u64,
size: PageSize,
dataptr: *mut u8,