diff options
| author | 2026-03-20 20:45:39 +0100 | |
|---|---|---|
| committer | 2026-03-23 22:35:38 +0100 | |
| commit | 80f4a7b5138d1c427ee5626e8a796aa6b2994a95 (patch) | |
| tree | cea1474b871f5a5962dafa19b65f1faadf9b9c45 /samples/kobject/ssh:/git@git.zx2c4.com/git: | |
| parent | rust: dma: add zeroed constructor to `Coherent` (diff) | |
rust: dma: introduce dma::CoherentBox for memory initialization
Currently, dma::Coherent cannot safely provide (mutable) access to its
underlying memory because the memory might be concurrently accessed by a
DMA device. This makes it difficult to safely initialize the memory
before handing it over to the hardware.
Introduce dma::CoherentBox, a type that encapsulates a dma::Coherent
before its DMA address is exposed to the device. dma::CoherentBox can
guarantee exclusive access to the inner dma::Coherent and implement
Deref and DerefMut.
Once the memory is properly initialized, dma::CoherentBox can be
converted into a regular dma::Coherent.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Link: https://patch.msgid.link/20260320194626.36263-5-dakr@kernel.org
[ Remove unnecessary trait bounds. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'samples/kobject/ssh:/git@git.zx2c4.com/git:')
0 files changed, 0 insertions, 0 deletions
