mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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>
24 lines
453 B
C
24 lines
453 B
C
// 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);
|
|
}
|