pub struct DmaPool { /* private fields */ }
Expand description
A pool for allocating DMA regions that all share a common access type and DMA options.
Implementations§
source§impl DmaPool
impl DmaPool
sourcepub fn new(spec: CreateSpec, access: Access, opts: DmaOptions) -> Self
pub fn new(spec: CreateSpec, access: Access, opts: DmaOptions) -> Self
Create a new DmaPool with access and DMA options, where each created underlying Twizzler object is created using the provided CreateSpec. If default (volatile) options are acceptable for the create spec, use the crate::dma::DmaPool::default_spec function.
sourcepub fn default_spec() -> CreateSpec
pub fn default_spec() -> CreateSpec
Generate a default CreateSpec for use in creating Twizzler DMA objects. By default, Twizzler objects for DMA are placed in volatile memory with a volatile lifetime.
sourcepub fn allocate<'a, T: DeviceSync>(
&'a self,
init: T,
) -> Result<DmaRegion<T>, AllocationError>
pub fn allocate<'a, T: DeviceSync>( &'a self, init: T, ) -> Result<DmaRegion<T>, AllocationError>
Allocate a new DmaRegion
sourcepub fn allocate_array<'a, T: DeviceSync + Clone>(
&'a self,
count: usize,
init: T,
) -> Result<DmaSliceRegion<T>, AllocationError>
pub fn allocate_array<'a, T: DeviceSync + Clone>( &'a self, count: usize, init: T, ) -> Result<DmaSliceRegion<T>, AllocationError>
Allocate a new DmaSliceRegion
sourcepub fn allocate_array_with<'a, T: DeviceSync>(
&'a self,
count: usize,
init: impl Fn() -> T,
) -> Result<DmaSliceRegion<T>, AllocationError>
pub fn allocate_array_with<'a, T: DeviceSync>( &'a self, count: usize, init: impl Fn() -> T, ) -> Result<DmaSliceRegion<T>, AllocationError>
Allocate a new DmaSliceRegion