Re: [PATCH 2/2] rust: add dma coherent allocator abstraction.

Abdiel Janulgue
2024-10-28T07:51:58Z

On 23/10/2024 14:32, Abdiel Janulgue wrote:
> Add a simple dma coherent allocator rust abstraction which was based on
> Andreas Hindborg's dma abstractions from the rnvme driver.
>
> This version:
> - Does not introduce the unused dma pool functionality for now.
> - Represents the internal CPU buffer as a slice instead of using raw
> pointer reads and writes.
> - Ensures both 32 and 64-bit DMA addressing works.
> - Make use of Result error-handling instead of Some.

Ping! Does this approach make sense? :)

>
> Co-developed-by: Wedson Almeida Filho <wedsonaf@gmail.com>
> Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
> Co-developed-by: Andreas Hindborg <a.hindborg@samsung.com>
> Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>
> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@gmail.com>
> ---
> rust/kernel/dma.rs | 153 +++++++++++++++++++++++++++++++++++++++++++++
> rust/kernel/lib.rs | 1 +
> 2 files changed, 154 insertions(+)
> create mode 100644 rust/kernel/dma.rs
>