]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rust: add bindings for bitmap.h
authorBurak Emir <bqe@google.com>
Mon, 8 Sep 2025 07:21:51 +0000 (07:21 +0000)
committerYury Norov (NVIDIA) <yury.norov@gmail.com>
Mon, 22 Sep 2025 19:52:44 +0000 (15:52 -0400)
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>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
MAINTAINERS
rust/bindings/bindings_helper.h
rust/helpers/bitmap.c [new file with mode: 0644]
rust/helpers/helpers.c

index 4a2db6c4b8abfef1d099b84a15c51c9f5639405f..543e4e8571247172a2bd93de99628ebbadabb1ac 100644 (file)
@@ -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
index 84d60635e8a9baef1f1a1b2752dc0fa044f8542f..7bb575043c86222134928123db04dae3bfc3035e 100644 (file)
@@ -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 (file)
index 0000000..a50e2f0
--- /dev/null
@@ -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);
+}
index 7cf7fe95e41dd51717050648d6160bebebdf4b26..8437736fdf28442372c743933b060ad07bee946e 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include "auxiliary.c"
+#include "bitmap.c"
 #include "blk.c"
 #include "bug.c"
 #include "build_assert.c"