pub enum Backend {
Linear {
pa_va_offset: usize,
},
Alloc {
populate: bool,
},
}
Expand description
A unified enum type for different memory mapping backends.
Currently, two backends are implemented:
- Linear: used for linear mappings. The target physical frames are contiguous and their addresses should be known when creating the mapping.
- Allocation: used in general, or for lazy mappings. The target physical frames are obtained from the global allocator.
Variants§
Linear
Linear mapping backend.
The offset between the virtual address and the physical address is
constant, which is specified by pa_va_offset
. For example, the virtual
address vaddr
is mapped to the physical address vaddr - pa_va_offset
.
Alloc
Allocation mapping backend.
If populate
is true
, all physical frames are allocated when the
mapping is created, and no page faults are triggered during the memory
access. Otherwise, the physical frames are allocated on demand (by
handling page faults).
Implementations§
Trait Implementations§
source§impl MappingBackend for Backend
impl MappingBackend for Backend
§type PageTable = PageTable64<X64PagingMetaData, X64PTE, PagingHandlerImpl>
type PageTable = PageTable64<X64PagingMetaData, X64PTE, PagingHandlerImpl>
The page table type used in the memory area.
source§fn map(
&self,
start: VirtAddr,
size: usize,
flags: MappingFlags,
pt: &mut PageTable
) -> bool
fn map( &self, start: VirtAddr, size: usize, flags: MappingFlags, pt: &mut PageTable ) -> bool
What to do when mapping a region within the area with the given flags.
Auto Trait Implementations§
impl Freeze for Backend
impl RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl UnwindSafe for Backend
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more