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-12-a2e13cbc17a6@google.com>
Date: Tue, 02 Dec 2025 19:37:36 +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>, 
	Yury Norov <yury.norov@...il.com>
Subject: [PATCH 12/46] rust: cpumask: add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
---
Cc: Yury Norov <yury.norov@...il.com>
---
 rust/helpers/cpumask.c | 32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

diff --git a/rust/helpers/cpumask.c b/rust/helpers/cpumask.c
index eb10598a0242f31598d0c401e194dce194ac85bf..74b561f7bf6f112c22e6a3ddb266ac003b06f531 100644
--- a/rust/helpers/cpumask.c
+++ b/rust/helpers/cpumask.c
@@ -2,68 +2,74 @@
 
 #include <linux/cpumask.h>
 
-void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
+__rust_helper void rust_helper_cpumask_set_cpu(unsigned int cpu,
+					       struct cpumask *dstp)
 {
 	cpumask_set_cpu(cpu, dstp);
 }
 
-void rust_helper___cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
+__rust_helper void rust_helper___cpumask_set_cpu(unsigned int cpu,
+						 struct cpumask *dstp)
 {
 	__cpumask_set_cpu(cpu, dstp);
 }
 
-void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
+__rust_helper void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
 {
 	cpumask_clear_cpu(cpu, dstp);
 }
 
-void rust_helper___cpumask_clear_cpu(int cpu, struct cpumask *dstp)
+__rust_helper void rust_helper___cpumask_clear_cpu(int cpu,
+						   struct cpumask *dstp)
 {
 	__cpumask_clear_cpu(cpu, dstp);
 }
 
-bool rust_helper_cpumask_test_cpu(int cpu, struct cpumask *srcp)
+__rust_helper bool rust_helper_cpumask_test_cpu(int cpu, struct cpumask *srcp)
 {
 	return cpumask_test_cpu(cpu, srcp);
 }
 
-void rust_helper_cpumask_setall(struct cpumask *dstp)
+__rust_helper void rust_helper_cpumask_setall(struct cpumask *dstp)
 {
 	cpumask_setall(dstp);
 }
 
-bool rust_helper_cpumask_empty(struct cpumask *srcp)
+__rust_helper bool rust_helper_cpumask_empty(struct cpumask *srcp)
 {
 	return cpumask_empty(srcp);
 }
 
-bool rust_helper_cpumask_full(struct cpumask *srcp)
+__rust_helper bool rust_helper_cpumask_full(struct cpumask *srcp)
 {
 	return cpumask_full(srcp);
 }
 
-unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
+__rust_helper unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
 {
 	return cpumask_weight(srcp);
 }
 
-void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
+__rust_helper void rust_helper_cpumask_copy(struct cpumask *dstp,
+					    const struct cpumask *srcp)
 {
 	cpumask_copy(dstp, srcp);
 }
 
-bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+__rust_helper bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask,
+						 gfp_t flags)
 {
 	return alloc_cpumask_var(mask, flags);
 }
 
-bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+__rust_helper bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask,
+						  gfp_t flags)
 {
 	return zalloc_cpumask_var(mask, flags);
 }
 
 #ifndef CONFIG_CPUMASK_OFFSTACK
-void rust_helper_free_cpumask_var(cpumask_var_t mask)
+__rust_helper void rust_helper_free_cpumask_var(cpumask_var_t mask)
 {
 	free_cpumask_var(mask);
 }

-- 
2.52.0.158.g65b55ccf14-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ