summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ryhl <aliceryhl@google.com>2025-12-02 22:37:39 +0300
committerDanilo Krummrich <dakr@kernel.org>2025-12-16 00:26:10 +0300
commit8a03afe94763108537e33b48378bbc7472b4cc9d (patch)
treea23c1dc766a6fd6934040316f7605e2507142322
parent93c7fa7416126dd29f78321f408044b474de8b8b (diff)
downloadlinux-8a03afe94763108537e33b48378bbc7472b4cc9d.tar.xz
rust: dma: add __rust_helper to helpers
This is needed to inline these helpers into Rust code. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Link: https://patch.msgid.link/20251202-define-rust-helper-v1-15-a2e13cbc17a6@google.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
-rw-r--r--rust/helpers/dma.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/rust/helpers/dma.c b/rust/helpers/dma.c
index 6e741c197242..8c7e8d7b888e 100644
--- a/rust/helpers/dma.c
+++ b/rust/helpers/dma.c
@@ -2,20 +2,23 @@
#include <linux/dma-mapping.h>
-void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size,
- dma_addr_t *dma_handle, gfp_t flag,
- unsigned long attrs)
+__rust_helper void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size,
+ dma_addr_t *dma_handle,
+ gfp_t flag, unsigned long attrs)
{
return dma_alloc_attrs(dev, size, dma_handle, flag, attrs);
}
-void rust_helper_dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
- dma_addr_t dma_handle, unsigned long attrs)
+__rust_helper void rust_helper_dma_free_attrs(struct device *dev, size_t size,
+ void *cpu_addr,
+ dma_addr_t dma_handle,
+ unsigned long attrs)
{
dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs);
}
-int rust_helper_dma_set_mask_and_coherent(struct device *dev, u64 mask)
+__rust_helper int rust_helper_dma_set_mask_and_coherent(struct device *dev,
+ u64 mask)
{
return dma_set_mask_and_coherent(dev, mask);
}