diff options
| author | Timur Tabi <ttabi@nvidia.com> | 2026-03-19 16:26:54 -0500 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-03-25 01:23:59 +0100 |
| commit | 69bfce0f25c8f949f7a02c3ed93e36aadad3fa57 (patch) | |
| tree | 22c6bb62e40f52e644be16fb266c92c50f736ffb /tools/perf/scripts/python/syscall-counts.py | |
| parent | d35ae50c5f48dfcd33cb24bf477ce912fa0af1f7 (diff) | |
rust: uaccess: add write_dma() for copying from DMA buffers to userspace
Add UserSliceWriter::write_dma() to copy data from a Coherent<[u8]> to
userspace. This provides a safe interface for copying DMA buffer
contents to userspace without requiring callers to work with raw
pointers.
Because write_dma() and write_slice() have common code, factor that code
out into a helper function, write_raw().
The method handles bounds checking and offset calculation internally,
wrapping the unsafe copy_to_user() call.
Signed-off-by: Timur Tabi <ttabi@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Tested-by: John Hubbard <jhubbard@nvidia.com>
Tested-by: Eliot Courtney <ecourtney@nvidia.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260319212658.2541610-3-ttabi@nvidia.com
[ Rebase onto Coherent<T> changes; remove unnecessary turbofish from
cast(). - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions
