Module dma

Module dma 

Source
Expand description

Direct Memory Access (DMA).

This module provides DmaCoherent and DmaStream abstractions for managing DMA memory regions with different remapping, caching and synchronization requirements.

§Usage in IRQs

Creating DMA objects (via alloc, alloc_uninit, or map constructors) requires IRQs to be enabled, to avoid deadlocks during cross-CPU TLB flushes. Note that it means DMA objects cannot be created from (hard) interrupt context.

Other operations on DMA objects may still be performed in any context, even with IRQs disabled. For example, it is valid to drop a DmaStream from an IRQ handler after the device has finished processing it.

Structs§

DmaCoherent
A DMA memory object that can be accessed in a cache-coherent manner.
DmaStream
A DMA memory object with streaming access.

Enums§

FromAndToDevice
Data flows both from and to the device.
FromDevice
Data flows from the device.
ToDevice
Data flows to the device.

Traits§

DmaDirection
DmaDirection limits the data flow direction of DmaStream and prevents users from reading and writing to DmaStream unexpectedly.