lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251202-define-rust-helper-v1-15-a2e13cbc17a6@google.com>
Date: Tue, 02 Dec 2025 19:37:39 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: rust-for-linux@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Alice Ryhl <aliceryhl@...gle.com>, 
	Danilo Krummrich <dakr@...nel.org>, Abdiel Janulgue <abdiel.janulgue@...il.com>, 
	Daniel Almeida <daniel.almeida@...labora.com>, Robin Murphy <robin.murphy@....com>, 
	Andreas Hindborg <a.hindborg@...nel.org>
Subject: [PATCH 15/46] rust: dma: add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
---
Cc: Danilo Krummrich <dakr@...nel.org>
Cc: Abdiel Janulgue <abdiel.janulgue@...il.com>
Cc: Daniel Almeida <daniel.almeida@...labora.com>
Cc: Robin Murphy <robin.murphy@....com>
Cc: Andreas Hindborg <a.hindborg@...nel.org>
---
 rust/helpers/dma.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/rust/helpers/dma.c b/rust/helpers/dma.c
index 6e741c197242572844fe550de4ddcd93520cbb42..8c7e8d7b888e3fe456b50cbb2a75306cc2a6cc2a 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);
 }

-- 
2.52.0.158.g65b55ccf14-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ