Expand description
memory set structure, controls virtual-memory space
Fields
page_table: PageTable
areas: Vec<MapArea>
Implementations
sourceimpl MemorySet
impl MemorySet
pub fn new_bare() -> Self
pub fn token(&self) -> usize
sourcepub fn insert_framed_area(
&mut self,
start_va: VirtAddr,
end_va: VirtAddr,
permission: MapPermission
)
pub fn insert_framed_area(
&mut self,
start_va: VirtAddr,
end_va: VirtAddr,
permission: MapPermission
)
Assume that no conflicts.
pub fn remove_area_with_start_vpn(&mut self, start_vpn: VirtPageNum)
fn push(&mut self, map_area: MapArea, data: Option<&[u8]>)
sourcefn map_trampoline(&mut self)
fn map_trampoline(&mut self)
Mention that trampoline is not collected by areas.
sourcepub fn new_kernel() -> Self
pub fn new_kernel() -> Self
Without kernel stacks.
sourcepub fn from_elf(elf_data: &[u8]) -> (Self, usize, usize)
pub fn from_elf(elf_data: &[u8]) -> (Self, usize, usize)
Include sections in elf and trampoline and TrapContext and user stack, also returns user_sp and entry point.
sourcepub fn from_existed_user(user_space: &MemorySet) -> MemorySet
pub fn from_existed_user(user_space: &MemorySet) -> MemorySet
Copy an identical user_space
pub fn activate(&self)
pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>
pub fn recycle_data_pages(&mut self)
Auto Trait Implementations
impl RefUnwindSafe for MemorySet
impl Send for MemorySet
impl Sync for MemorySet
impl Unpin for MemorySet
impl UnwindSafe for MemorySet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more