Struct axmem::AddrSpaceInner
source · pub struct AddrSpaceInner { /* private fields */ }
Expand description
mutable inner objects of address space
Implementations§
source§impl AddrSpaceInner
impl AddrSpaceInner
sourcepub fn add_region(
&mut self,
vaddr: VirtAddr,
paddr: PhysAddr,
phy_page: Arc<GlobalPage>,
flags: MappingFlags,
huge_page: bool
) -> AxResult<()>
pub fn add_region( &mut self, vaddr: VirtAddr, paddr: PhysAddr, phy_page: Arc<GlobalPage>, flags: MappingFlags, huge_page: bool ) -> AxResult<()>
create a segment region
sourcepub fn add_region_shadow(
&mut self,
vaddr: VirtAddr,
paddr: PhysAddr,
size: usize,
flags: MappingFlags,
huge_page: bool
) -> AxResult<()>
pub fn add_region_shadow( &mut self, vaddr: VirtAddr, paddr: PhysAddr, size: usize, flags: MappingFlags, huge_page: bool ) -> AxResult<()>
create a segment region without memory allocation
sourcepub fn remove_region(&mut self, vaddr: VirtAddr) -> AxResult<()>
pub fn remove_region(&mut self, vaddr: VirtAddr) -> AxResult<()>
remove a segment
sourcepub fn page_table_addr(&self) -> PhysAddr
pub fn page_table_addr(&self) -> PhysAddr
get root address of pagetable
sourcepub fn mmap_page(
&mut self,
_addr: Option<VirtAddr>,
len: usize,
flags: MappingFlags
) -> AxResult<VirtAddr>
pub fn mmap_page( &mut self, _addr: Option<VirtAddr>, len: usize, flags: MappingFlags ) -> AxResult<VirtAddr>
a simple mmap-like page allocator, except that memory is alloced in pages @param addr: desired memory position @param len: desired pages @returns: starting addr of the maped pages
sourcepub fn munmap_page(&mut self, addr: VirtAddr, len: usize) -> AxResult<()>
pub fn munmap_page(&mut self, addr: VirtAddr, len: usize) -> AxResult<()>
unmap a page obtained from mmap
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for AddrSpaceInner
impl Send for AddrSpaceInner
impl Sync for AddrSpaceInner
impl Unpin for AddrSpaceInner
impl UnwindSafe for AddrSpaceInner
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