Skip to content

Commit 0452b4a

Browse files
Burak EmirYuryNorov
authored andcommitted
rust: add bindings for bitmap.h
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>
1 parent 4688bb1 commit 0452b4a

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4299,6 +4299,7 @@ F: tools/lib/find_bit.c
42994299
BITMAP API BINDINGS [RUST]
43004300
M: Yury Norov <yury.norov@gmail.com>
43014301
S: Maintained
4302+
F: rust/helpers/bitmap.c
43024303
F: rust/helpers/cpumask.c
43034304

43044305
BITOPS API

rust/bindings/bindings_helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <drm/drm_ioctl.h>
3737
#include <kunit/test.h>
3838
#include <linux/auxiliary_bus.h>
39+
#include <linux/bitmap.h>
3940
#include <linux/blk-mq.h>
4041
#include <linux/blk_types.h>
4142
#include <linux/blkdev.h>

rust/helpers/bitmap.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <linux/bitmap.h>
4+
5+
void rust_helper_bitmap_copy_and_extend(unsigned long *to, const unsigned long *from,
6+
unsigned int count, unsigned int size)
7+
{
8+
bitmap_copy_and_extend(to, from, count, size);
9+
}

rust/helpers/helpers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
#include "auxiliary.c"
11+
#include "bitmap.c"
1112
#include "blk.c"
1213
#include "bug.c"
1314
#include "build_assert.c"

0 commit comments

Comments
 (0)