mirror of
https://github.com/torvalds/linux.git
synced 2026-01-24 23:16:46 +00:00
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>
This commit is contained in:
committed by
Yury Norov (NVIDIA)
parent
0452b4ab29
commit
6cf93a9ed3
@@ -4316,6 +4316,11 @@ F: include/linux/bitops.h
|
|||||||
F: lib/test_bitops.c
|
F: lib/test_bitops.c
|
||||||
F: tools/*/bitops*
|
F: tools/*/bitops*
|
||||||
|
|
||||||
|
BITOPS API BINDINGS [RUST]
|
||||||
|
M: Yury Norov <yury.norov@gmail.com>
|
||||||
|
S: Maintained
|
||||||
|
F: rust/helpers/bitops.c
|
||||||
|
|
||||||
BLINKM RGB LED DRIVER
|
BLINKM RGB LED DRIVER
|
||||||
M: Jan-Simon Moeller <jansimon.moeller@gmx.de>
|
M: Jan-Simon Moeller <jansimon.moeller@gmx.de>
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|||||||
23
rust/helpers/bitops.c
Normal file
23
rust/helpers/bitops.c
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
|
void rust_helper___set_bit(unsigned long nr, unsigned long *addr)
|
||||||
|
{
|
||||||
|
__set_bit(nr, addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rust_helper___clear_bit(unsigned long nr, unsigned long *addr)
|
||||||
|
{
|
||||||
|
__clear_bit(nr, addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rust_helper_set_bit(unsigned long nr, volatile unsigned long *addr)
|
||||||
|
{
|
||||||
|
set_bit(nr, addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rust_helper_clear_bit(unsigned long nr, volatile unsigned long *addr)
|
||||||
|
{
|
||||||
|
clear_bit(nr, addr);
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "auxiliary.c"
|
#include "auxiliary.c"
|
||||||
#include "bitmap.c"
|
#include "bitmap.c"
|
||||||
|
#include "bitops.c"
|
||||||
#include "blk.c"
|
#include "blk.c"
|
||||||
#include "bug.c"
|
#include "bug.c"
|
||||||
#include "build_assert.c"
|
#include "build_assert.c"
|
||||||
|
|||||||
Reference in New Issue
Block a user