pub struct MemoryArea<B: MappingBackend> { /* private fields */ }Expand description
A memory area represents a continuous range of virtual memory with the same flags.
The target physical memory frames are determined by MappingBackend and
may not be contiguous.
Implementations§
Source§impl<B: MappingBackend> MemoryArea<B>
impl<B: MappingBackend> MemoryArea<B>
Sourcepub fn try_new(
start: B::Addr,
size: usize,
flags: B::Flags,
backend: B,
) -> MappingResult<Self>
pub fn try_new( start: B::Addr, size: usize, flags: B::Flags, backend: B, ) -> MappingResult<Self>
Fallible counterpart of Self::new. New code that receives
untrusted address/length pairs should use this constructor so an
overflow is represented as a mapping error instead of a panic.
Sourcepub fn try_new_with_reported_flags(
start: B::Addr,
size: usize,
flags: B::Flags,
reported_flags: B::Flags,
backend: B,
) -> MappingResult<Self>
pub fn try_new_with_reported_flags( start: B::Addr, size: usize, flags: B::Flags, reported_flags: B::Flags, backend: B, ) -> MappingResult<Self>
Fallible constructor with separate operational and reported flags.
Sourcepub fn new_with_reported_flags(
start: B::Addr,
size: usize,
flags: B::Flags,
reported_flags: B::Flags,
backend: B,
) -> Self
pub fn new_with_reported_flags( start: B::Addr, size: usize, flags: B::Flags, reported_flags: B::Flags, backend: B, ) -> Self
Creates a new memory area with separate backend and reported flags.
flags are used for page-table/backend operations. reported_flags
are metadata exposed through introspection interfaces such as procfs.
§Panics
Panics if start + size overflows.
Sourcepub fn new_with_permissions(
start: B::Addr,
size: usize,
flags: B::Flags,
reported_flags: B::Flags,
max_flags: B::Flags,
backend: B,
) -> Self
pub fn new_with_permissions( start: B::Addr, size: usize, flags: B::Flags, reported_flags: B::Flags, max_flags: B::Flags, backend: B, ) -> Self
Creates an area with an explicit maximum permission envelope.
Sourcepub fn try_new_with_permissions(
start: B::Addr,
size: usize,
flags: B::Flags,
reported_flags: B::Flags,
max_flags: B::Flags,
backend: B,
) -> MappingResult<Self>
pub fn try_new_with_permissions( start: B::Addr, size: usize, flags: B::Flags, reported_flags: B::Flags, max_flags: B::Flags, backend: B, ) -> MappingResult<Self>
Fallible constructor with an explicit maximum permission envelope.
This is the constructor used at syscall boundaries. The older
infallible constructors remain available for trusted boot-time
mappings, but user supplied start + size pairs must not be allowed to
wrap through AddrRange::from_start_size.
Sourcepub const fn reported_flags(&self) -> B::Flags
pub const fn reported_flags(&self) -> B::Flags
Returns the permission flags reported to user-visible introspection.
Trait Implementations§
Source§impl<B: Clone + MappingBackend> Clone for MemoryArea<B>
impl<B: Clone + MappingBackend> Clone for MemoryArea<B>
Source§fn clone(&self) -> MemoryArea<B>
fn clone(&self) -> MemoryArea<B>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more