Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: add bindings for bitops.h

Makes atomic set_bit and clear_bit inline functions as well as the
non-atomic variants __set_bit and __clear_bit available to Rust.
Adds a new MAINTAINERS section BITOPS 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>

authored by

Burak Emir and committed by
Yury Norov (NVIDIA)
6cf93a9e 0452b4ab

+29
+5
MAINTAINERS
··· 4316 4316 F: lib/test_bitops.c 4317 4317 F: tools/*/bitops* 4318 4318 4319 + BITOPS API BINDINGS [RUST] 4320 + M: Yury Norov <yury.norov@gmail.com> 4321 + S: Maintained 4322 + F: rust/helpers/bitops.c 4323 + 4319 4324 BLINKM RGB LED DRIVER 4320 4325 M: Jan-Simon Moeller <jansimon.moeller@gmx.de> 4321 4326 S: Maintained
+23
rust/helpers/bitops.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <linux/bitops.h> 4 + 5 + void rust_helper___set_bit(unsigned long nr, unsigned long *addr) 6 + { 7 + __set_bit(nr, addr); 8 + } 9 + 10 + void rust_helper___clear_bit(unsigned long nr, unsigned long *addr) 11 + { 12 + __clear_bit(nr, addr); 13 + } 14 + 15 + void rust_helper_set_bit(unsigned long nr, volatile unsigned long *addr) 16 + { 17 + set_bit(nr, addr); 18 + } 19 + 20 + void rust_helper_clear_bit(unsigned long nr, volatile unsigned long *addr) 21 + { 22 + clear_bit(nr, addr); 23 + }
+1
rust/helpers/helpers.c
··· 9 9 10 10 #include "auxiliary.c" 11 11 #include "bitmap.c" 12 + #include "bitops.c" 12 13 #include "blk.c" 13 14 #include "bug.c" 14 15 #include "build_assert.c"