ostd/mm/dma/
mod.rs

1// SPDX-License-Identifier: MPL-2.0
2
3//! Direct Memory Access (DMA).
4//!
5//! This module provides [`DmaCoherent`] and [`DmaStream`] abstractions for
6//! managing DMA memory regions with different remapping, caching and
7//! synchronization requirements.
8//!
9//! # Usage in IRQs
10//!
11//! Creating DMA objects (via `alloc`, `alloc_uninit`, or `map` constructors)
12//! requires IRQs to be enabled, to avoid deadlocks during cross-CPU TLB
13//! flushes. Note that it means DMA objects cannot be created from (hard)
14//! interrupt context.
15//!
16//! Other operations on DMA objects may still be performed in any context,
17//! even with IRQs disabled. For example, it is valid to drop a [`DmaStream`]
18//! from an IRQ handler after the device has finished processing it.
19
20#[cfg(ktest)]
21mod test;
22
23mod dma_coherent;
24mod dma_stream;
25mod util;
26
27pub use dma_coherent::DmaCoherent;
28pub use dma_stream::{DmaDirection, DmaStream, FromAndToDevice, FromDevice, ToDevice};