xref: /kvm-unit-tests/lib/riscv/asm/bitops.h (revision 05a764725512259a073c804f2616fb4f5ac461e8)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _ASMRISCV_BITOPS_H_
3 #define _ASMRISCV_BITOPS_H_
4 
5 #ifndef _BITOPS_H_
6 #error only <bitops.h> can be included directly
7 #endif
8 
9 #ifdef CONFIG_64BIT
10 #define BITS_PER_LONG	64
11 #else
12 #define BITS_PER_LONG	32
13 #endif
14 
15 void set_bit(int nr, volatile unsigned long *addr);
16 void clear_bit(int nr, volatile unsigned long *addr);
17 int test_bit(int nr, const volatile unsigned long *addr);
18 int test_and_set_bit(int nr, volatile unsigned long *addr);
19 int test_and_clear_bit(int nr, volatile unsigned long *addr);
20 
21 #endif /* _ASMRISCV_BITOPS_H_ */
22