From: Burak Emir <bqe@google.com>
To: Yury Norov <yury.norov@gmail.com>, Kees Cook <kees@kernel.org>
Cc: "Burak Emir" <bqe@google.com>,
"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Gustavo A . R . Silva" <gustavoars@kernel.org>,
"Carlos LLama" <cmllamas@google.com>,
"Pekka Ristola" <pekkarr@protonmail.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: [PATCH v15 1/5] rust: add bindings for bitmap.h
Date: Thu, 4 Sep 2025 16:50:05 +0000 [thread overview]
Message-ID: <20250904165015.3791895-2-bqe@google.com> (raw)
In-Reply-To: <20250904165015.3791895-1-bqe@google.com>
Makes the bitmap_copy_and_extend inline function available to Rust.
Adds F: to existing MAINTAINERS section BITMAP API BINDINGS [RUST].
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Suggested-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Burak Emir <bqe@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Yury Norov [NVIDIA] <yury.norov@gmail.com>
-
---
MAINTAINERS | 1 +
rust/bindings/bindings_helper.h | 1 +
rust/helpers/bitmap.c | 9 +++++++++
rust/helpers/helpers.c | 1 +
4 files changed, 12 insertions(+)
create mode 100644 rust/helpers/bitmap.c
diff --git a/MAINTAINERS b/MAINTAINERS
index cecb0419a537..c1d72e26fba8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4299,6 +4299,7 @@ F: tools/lib/find_bit.c
BITMAP API BINDINGS [RUST]
M: Yury Norov <yury.norov@gmail.com>
S: Maintained
+F: rust/helpers/bitmap.c
F: rust/helpers/cpumask.c
BITOPS API
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
index 84d60635e8a9..7bb575043c86 100644
--- a/rust/bindings/bindings_helper.h
+++ b/rust/bindings/bindings_helper.h
@@ -36,6 +36,7 @@
#include <drm/drm_ioctl.h>
#include <kunit/test.h>
#include <linux/auxiliary_bus.h>
+#include <linux/bitmap.h>
#include <linux/blk-mq.h>
#include <linux/blk_types.h>
#include <linux/blkdev.h>
diff --git a/rust/helpers/bitmap.c b/rust/helpers/bitmap.c
new file mode 100644
index 000000000000..a50e2f082e47
--- /dev/null
+++ b/rust/helpers/bitmap.c
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/bitmap.h>
+
+void rust_helper_bitmap_copy_and_extend(unsigned long *to, const unsigned long *from,
+ unsigned int count, unsigned int size)
+{
+ bitmap_copy_and_extend(to, from, count, size);
+}
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 7cf7fe95e41d..8437736fdf28 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -8,6 +8,7 @@
*/
#include "auxiliary.c"
+#include "bitmap.c"
#include "blk.c"
#include "bug.c"
#include "build_assert.c"
--
2.51.0.355.g5224444f11-goog
next prev parent reply other threads:[~2025-09-04 16:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 16:50 [PATCH v15 0/5] rust: adds Bitmap API, ID pool and bindings Burak Emir
2025-09-04 16:50 ` Burak Emir [this message]
2025-09-04 16:50 ` [PATCH v15 2/5] rust: add bindings for bitops.h Burak Emir
2025-09-04 16:50 ` [PATCH v15 3/5] rust: add bitmap API Burak Emir
2025-09-06 18:15 ` kernel test robot
2025-09-04 16:50 ` [PATCH v15 4/5] rust: add find_bit_benchmark_rust module Burak Emir
2025-09-04 16:50 ` [PATCH v15 5/5] rust: add dynamic ID pool abstraction for bitmap Burak Emir
2025-09-04 18:02 ` [PATCH v15 0/5] rust: adds Bitmap API, ID pool and bindings Yury Norov
2025-09-05 9:29 ` Miguel Ojeda
2025-09-05 13:18 ` Yury ooNorov
2025-09-05 15:56 ` Miguel Ojeda
2025-09-05 21:51 ` Yury Norov
2025-09-05 21:48 ` Yury Norov
2025-09-06 0:46 ` Philip Li
2025-09-06 14:24 ` Yury Norov
2025-09-06 9:05 ` Dan Carpenter
2025-09-06 9:18 ` Dan Carpenter
2025-09-06 14:27 ` Yury Norov
2025-09-08 7:25 ` Burak Emir
2025-09-08 9:24 ` Miguel Ojeda
2025-09-08 10:03 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250904165015.3791895-2-bqe@google.com \
--to=bqe@google.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=cmllamas@google.com \
--cc=gary@garyguo.net \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=ojeda@kernel.org \
--cc=pekkarr@protonmail.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=viresh.kumar@linaro.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.