MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / translate

Function translate

crates/virtual-machine/src/cpu/mmu.rs:337–350  ·  view source on GitHub ↗

Backwards-compatible wrapper keeping the original `translate()` signature. Calls the extended translator with PMP disabled (pmpcfg0=0, pmpaddr0=0).

(
    vaddr: u64,
    satp: u64,
    priv_mode: PrivilegeMode,
    mstatus: u64,
    bus: &mut impl MemoryAccess,
    is_write: bool,
    is_execute: bool,
)

Source from the content-addressed store, hash-verified

335
336 return Ok(phys_addr);
337 } else {
338 // Non-leaf PTE: W=1 is reserved for non-leaf entries.
339 if w == 1 {
340 return Err(VmError::PageFault(vaddr));
341 }
342 current_ppn = (pte >> 10) & 0x0000_0FFF_FFFF_FFFF;
343 }
344 }
345
346 Err(VmError::PageFault(vaddr))
347}
348
349/// Backwards-compatible wrapper keeping the original `translate()` signature.
350/// Calls the extended translator with PMP disabled (pmpcfg0=0, pmpaddr0=0).
351pub fn translate(
352 vaddr: u64,
353 satp: u64,

Calls 1

translate_with_pmpFunction · 0.85