pub trait MappingBackend: Clone {
type Addr: MemoryAddr;
type Flags: Copy;
type PageTable;
// Required methods
fn map(
&self,
start: Self::Addr,
size: usize,
flags: Self::Flags,
page_table: &mut Self::PageTable,
) -> bool;
fn unmap(
&self,
start: Self::Addr,
size: usize,
page_table: &mut Self::PageTable,
) -> bool;
fn protect(
&self,
start: Self::Addr,
size: usize,
new_flags: Self::Flags,
page_table: &mut Self::PageTable,
) -> bool;
}
Expand description
Underlying operations to do when manipulating mappings within the specific
MemoryArea
.
The backend can be different for different memory areas. e.g., for linear mappings, the target physical address is known when it is added to the page table. For lazy mappings, an empty mapping needs to be added to the page table to trigger a page fault.
Required Associated Types§
Sourcetype Addr: MemoryAddr
type Addr: MemoryAddr
The address type used in the memory area.
Required Methods§
Sourcefn map(
&self,
start: Self::Addr,
size: usize,
flags: Self::Flags,
page_table: &mut Self::PageTable,
) -> bool
fn map( &self, start: Self::Addr, size: usize, flags: Self::Flags, page_table: &mut Self::PageTable, ) -> bool
What to do when mapping a region within the area with the given flags.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.