Struct dma_buf::MappedDmaBuf
source · pub struct MappedDmaBuf { /* private fields */ }
Expand description
A DmaBuf
mapped in memory
Implementations§
source§impl MappedDmaBuf
impl MappedDmaBuf
sourcepub fn read<A, F, R>(&self, f: F, arg: Option<A>) -> Result<R, BufferError>
pub fn read<A, F, R>(&self, f: F, arg: Option<A>) -> Result<R, BufferError>
Calls a closure to read the buffer content
DMA-Buf requires the user-space to call the DMA_BUF_IOCTL_SYNC
ioctl before and after any
CPU access to a buffer in order to maintain the cache coherency. The closure will be run
with those primitives called for a read access from the CPU.
The result of the closure will be returned.
§Errors
Will return [Error] if the underlying ioctl or the closure fails
sourcepub fn readwrite<A, F, R>(
&mut self,
f: F,
arg: Option<A>,
) -> Result<R, BufferError>
pub fn readwrite<A, F, R>( &mut self, f: F, arg: Option<A>, ) -> Result<R, BufferError>
Calls a closure to read from and write to the buffer content
DMA-Buf requires the user-space to call the DMA_BUF_IOCTL_SYNC
ioctl before and after any
CPU access to a buffer in order to maintain the cache coherency. The closure will be run
with those primitives called for a read and write access from the CPU.
The result of the closure will be returned on success. On failure, the closure must return
Error::Closure
§Errors
Will return [Error] if the underlying ioctl or the closure fails
sourcepub fn write<A, F>(&mut self, f: F, arg: Option<A>) -> Result<(), BufferError>
pub fn write<A, F>(&mut self, f: F, arg: Option<A>) -> Result<(), BufferError>
Calls a closure to read from and write to the buffer content
DMA-Buf requires the user-space to call the DMA_BUF_IOCTL_SYNC
ioctl before and after any
CPU access to a buffer in order to maintain the cache coherency. The closure will be run
with those primitives called for a read and write access from the CPU.
The closure must return () on success. On failure, the closure must return Error::Closure
.
§Errors
Will return [Error] if the underlying ioctl or the closure fails