pub struct PhysPage {
pub start_vaddr: VirtAddr,
}
Expand description
A safe wrapper of a single 4K page. It holds the page’s VirtAddr (PhysAddr + offset)
Fields§
§start_vaddr: VirtAddr
The start virtual address of this page.
Implementations§
source§impl PhysPage
impl PhysPage
sourcepub fn alloc_contiguous(
num_pages: usize,
align_pow2: usize,
data: Option<&[u8]>
) -> AxResult<Vec<Option<Self>>>
pub fn alloc_contiguous( num_pages: usize, align_pow2: usize, data: Option<&[u8]> ) -> AxResult<Vec<Option<Self>>>
Allocate some 4K-sized pages and fill with zero.
sourcepub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_mut_ptr(&mut self) -> *mut u8
Convert to a mutable raw pointer.
sourcepub fn as_slice_mut(&mut self) -> &mut [u8]
pub fn as_slice_mut(&mut self) -> &mut [u8]
Forms a mutable slice that can write data.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for PhysPage
impl Send for PhysPage
impl Sync for PhysPage
impl Unpin for PhysPage
impl UnwindSafe for PhysPage
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