pub struct Mapping<R: Mappable, A: Ty> {
pub(super) raw: R,
pub(super) address_space: ManuallyDrop<A>,
pub(super) backing: ManuallyDrop<Backing>,
pub(super) caching: Caching,
pub(super) virtual_start: RawPage,
pub(super) protection: Protection,
}Available on crate feature
full only.Expand description
The raw type underlying all memory mappings.
This will allocate any required memory when created, and register any lazily mapped memory as such. It will also manage the page tables to correctly unmap the memory when dropped.
Fields§
§raw: R§address_space: ManuallyDrop<A>The address space mapped into
backing: ManuallyDrop<Backing>§caching: Caching§virtual_start: RawPage§protection: ProtectionThe protection used when mapping pages into this mapping
Implementations§
Source§impl<R: Mappable> Mapping<R, Kernel>
impl<R: Mappable> Mapping<R, Kernel>
pub fn as_mut_ptr_range(&mut self) -> Range<*mut u8>
pub fn as_ptr_range(&self) -> Range<*const u8>
pub fn as_mut_ptr(&mut self) -> *mut u8
pub fn as_ptr(&self) -> *const u8
pub unsafe fn from_raw_parts<const RAM: bool, T>(
frames: Frames<RAM, T>,
base_page: RawPage,
protection: Protection,
caching: Caching,
) -> Selfwhere
R: Default,
pub fn into_raw_parts( self, ) -> (Option<Frames<false>>, RawPage, Protection, Caching)
Source§impl<R: Mappable> Mapping<R, Userspace>
impl<R: Mappable> Mapping<R, Userspace>
pub fn as_mut_ptr_range(&mut self) -> Range<User<'_, *mut u8>>
Available on non-crate feature
use_std only.pub fn as_ptr_range(&self) -> Range<User<'_, *const u8>>
Available on non-crate feature
use_std only.pub fn as_mut_ptr(&mut self) -> User<'_, *mut u8>
Available on non-crate feature
use_std only.pub fn as_ptr(&self) -> User<'_, *const u8>
Available on non-crate feature
use_std only.Source§impl<R: Mappable, A: Ty> Mapping<R, A>
impl<R: Mappable, A: Ty> Mapping<R, A>
pub fn grow_in_place_by( &mut self, extra_length: usize, ) -> Result<(), AllocError>
pub fn byte_len(&self) -> usize
pub fn page_len(&self) -> usize
pub fn physical_start(&self) -> Option<RawFrame>
Sourcepub fn virtual_valid_start(&self) -> RawPage
pub fn virtual_valid_start(&self) -> RawPage
The first page in the mapping that is mapped to physical memory.
The region of virtual memory from virtual_valid_start() to virtual_valid_start() + physical_length is mapped.