pub struct CachedVmoMemory(/* private fields */);Expand description
A wrapper around VmoMemory guaranteed to be mapped with cached memory
policy.
Implementations§
Source§impl CachedVmoMemory
impl CachedVmoMemory
Sourcepub unsafe fn new_unchecked(inner: VmoMemory) -> Self
pub unsafe fn new_unchecked(inner: VmoMemory) -> Self
Creates a new cached vmo memory from mapped memory.
§Safety
The caller must ensure that the mapped VMO is mapped with
zx::CachePolicy::Cached.
Sourcepub fn map(
offset: usize,
size: usize,
vmo: Vmo,
) -> Result<MmioRegion<Self>, Status>
pub fn map( offset: usize, size: usize, vmo: Vmo, ) -> Result<MmioRegion<Self>, Status>
Maps vmo at offset with size ensuring the correct cache policy.
Sourcepub fn new_mapped(size: usize) -> Result<MmioRegion<Self>, Status>
pub fn new_mapped(size: usize) -> Result<MmioRegion<Self>, Status>
Creates a new VMO of size bytes and maps it into memory with cached
cache policy.
Trait Implementations§
Source§impl UnsafeMmio for CachedVmoMemory
impl UnsafeMmio for CachedVmoMemory
Source§fn len(&self) -> usize
fn len(&self) -> usize
Returns the size, in bytes, of the underlying MMIO region that can be accessed through this
object.
Source§fn align_offset(&self, align: usize) -> usize
fn align_offset(&self, align: usize) -> usize
Returns the first offset into this MMIO region that is suitably aligned for
align. Read moreSource§unsafe fn load8_unchecked(&self, offset: usize) -> u8
unsafe fn load8_unchecked(&self, offset: usize) -> u8
Loads a u8 from this MMIO region at the given offset. Read more
Source§unsafe fn load16_unchecked(&self, offset: usize) -> u16
unsafe fn load16_unchecked(&self, offset: usize) -> u16
Loads a u16 from this MMIO region at the given offset. Read more
Source§unsafe fn load32_unchecked(&self, offset: usize) -> u32
unsafe fn load32_unchecked(&self, offset: usize) -> u32
Loads a u32 from this MMIO region at the given offset. Read more
Source§unsafe fn load64_unchecked(&self, offset: usize) -> u64
unsafe fn load64_unchecked(&self, offset: usize) -> u64
Loads a u64 from this MMIO region at the given offset. Read more
Source§unsafe fn store8_unchecked(&self, offset: usize, v: u8)
unsafe fn store8_unchecked(&self, offset: usize, v: u8)
Stores a u8 to this MMIO region at the given offset. Read more
Source§unsafe fn store16_unchecked(&self, offset: usize, v: u16)
unsafe fn store16_unchecked(&self, offset: usize, v: u16)
Stores a u16 to this MMIO region at the given offset. Read more
Source§unsafe fn store32_unchecked(&self, offset: usize, v: u32)
unsafe fn store32_unchecked(&self, offset: usize, v: u32)
Stores a u32 to this MMIO region at the given offset. Read more
Source§unsafe fn store64_unchecked(&self, offset: usize, v: u64)
unsafe fn store64_unchecked(&self, offset: usize, v: u64)
Stores a u64 to this MMIO region at the given offset. Read more
Source§fn write_barrier(&self)
fn write_barrier(&self)
Issues a memory write barrier. It is guaranteed that all stores preceding this barrier will
appear to have happened before all stores following this barrier.
Source§fn read_barrier(&self)
fn read_barrier(&self)
Issues a memory read barrier. It is guaranteed that all loads preceding this barrier will
appear to have happened before all loads following this barrier. Read more
Auto Trait Implementations§
impl Freeze for CachedVmoMemory
impl RefUnwindSafe for CachedVmoMemory
impl Send for CachedVmoMemory
impl Sync for CachedVmoMemory
impl Unpin for CachedVmoMemory
impl UnsafeUnpin for CachedVmoMemory
impl UnwindSafe for CachedVmoMemory
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