pub struct MemorySet {
page_table: PageTable,
areas: Vec<MapArea>,
}
Expand description
address space
Fields§
§page_table: PageTable
§areas: Vec<MapArea>
Implementations§
source§impl MemorySet
impl MemorySet
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.
sourcepub fn remove_area_with_start_vpn(&mut self, start_vpn: VirtPageNum)
pub fn remove_area_with_start_vpn(&mut self, start_vpn: VirtPageNum)
remove a area
sourcefn push(&mut self, map_area: MapArea, data: Option<&[u8]>)
fn push(&mut self, map_area: MapArea, data: Option<&[u8]>)
Add a new MapArea into this MemorySet. Assuming that there are no conflicts in the virtual address space.
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_base and entry point.
sourcepub fn from_existed_user(user_space: &Self) -> Self
pub fn from_existed_user(user_space: &Self) -> Self
Create a new address space by copy code&data from a exited process’s address space.
sourcepub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>
pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>
Translate a virtual page number to a page table entry
sourcepub fn recycle_data_pages(&mut self)
pub fn recycle_data_pages(&mut self)
Remove all MapArea
Auto Trait Implementations§
impl Freeze for MemorySet
impl RefUnwindSafe for MemorySet
impl Send for MemorySet
impl Sync for MemorySet
impl Unpin for MemorySet
impl UnwindSafe for MemorySet
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