pub trait Translate {
    // Required method
    fn translate(&self, addr: VirtAddr) -> TranslateResult;

    // Provided method
    fn translate_addr(&self, addr: VirtAddr) -> Option<PhysAddr> { ... }
}
Expand description

Provides methods for translating virtual addresses.

Required Methods§

source

fn translate(&self, addr: VirtAddr) -> TranslateResult

Return the frame that the given virtual address is mapped to and the offset within that frame.

If the given address has a valid mapping, the mapped frame and the offset within that frame is returned. Otherwise an error value is returned.

This function works with huge pages of all sizes.

Provided Methods§

source

fn translate_addr(&self, addr: VirtAddr) -> Option<PhysAddr>

Translates the given virtual address to the physical address that it maps to.

Returns None if there is no valid mapping for the given address.

This is a convenience method. For more information about a mapping see the translate method.

Implementors§

source§

impl<'a> Translate for OffsetPageTable<'a>

Available on 64-bit only.
source§

impl<'a> Translate for RecursivePageTable<'a>

Available on crate feature instructions only.
source§

impl<'a, P: PageTableFrameMapping> Translate for MappedPageTable<'a, P>