]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: dma: implement BinaryWriter for Coherent<[u8]>
authorTimur Tabi <ttabi@nvidia.com>
Thu, 19 Mar 2026 21:26:55 +0000 (16:26 -0500)
committerDanilo Krummrich <dakr@kernel.org>
Wed, 25 Mar 2026 00:24:11 +0000 (01:24 +0100)
commit01681851393642e10b5cc3f35eb6a1916ee4aff1
treead72d3d87c2a9972ca19c8ce4e48e0f4d5d31094
parent69bfce0f25c8f949f7a02c3ed93e36aadad3fa57
rust: dma: implement BinaryWriter for Coherent<[u8]>

Implement the BinaryWriter trait for Coherent<[u8]>, enabling DMA
coherent allocations to be exposed as readable binary files.  The
implementation handles offset tracking and bounds checking, copying data
from the coherent allocation to userspace via write_dma().

Signed-off-by: Timur Tabi <ttabi@nvidia.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: John Hubbard <jhubbard@nvidia.com>
Tested-by: Eliot Courtney <ecourtney@nvidia.com>
Link: https://patch.msgid.link/20260319212658.2541610-4-ttabi@nvidia.com
[ Rebase onto Coherent<T> changes. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/dma.rs