pub struct MemObject {
frames: SharedRing,
size: u64,
_charge: Option<MemCharge>,
}Expand description
A shareable, mappable memory object.
Fields§
§frames: SharedRing§size: u64Page-rounded size in bytes.
_charge: Option<MemCharge>Implementations§
Source§impl MemObject
impl MemObject
Sourcepub fn create(
size: u64,
charge: Option<MemCharge>,
) -> Result<MemObject, SyscallError>
pub fn create( size: u64, charge: Option<MemCharge>, ) -> Result<MemObject, SyscallError>
Allocate a zeroed object of size bytes (rounded up to pages).
charge pays for the backing; it is taken by the caller so a quota
failure happens before any frame is allocated.
Sourcepub fn map(
&self,
aspace: &AddressSpace,
rights: u32,
addr_hint: u64,
offset: u64,
len: u64,
prot: u32,
) -> Result<u64, SyscallError>
pub fn map( &self, aspace: &AddressSpace, rights: u32, addr_hint: u64, offset: u64, len: u64, prot: u32, ) -> Result<u64, SyscallError>
Map [offset, offset + len) of the object into aspace.
prot (MEMOBJ_PROT_*) must be covered by rights (MEM_*);
addr_hint == 0 lets the kernel choose. Returns the mapped address.
Auto Trait Implementations§
impl !RefUnwindSafe for MemObject
impl !UnwindSafe for MemObject
impl Forget for MemObject
impl Freeze for MemObject
impl Move for MemObject
impl Send for MemObject
impl Sync for MemObject
impl Unpin for MemObject
impl UnsafeUnpin for MemObject
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more