1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 #ifndef __ASM_RISCV_GUEST_ATOMICS_H 3 #define __ASM_RISCV_GUEST_ATOMICS_H 4 5 #include <xen/bug.h> 6 7 #define guest_testop(name) \ 8 static inline int guest_##name(struct domain *d, int nr, volatile void *p) \ 9 { \ 10 BUG_ON("unimplemented"); \ 11 \ 12 return 0; \ 13 } 14 15 #define guest_bitop(name) \ 16 static inline void guest_##name(struct domain *d, int nr, volatile void *p) \ 17 { \ 18 BUG_ON("unimplemented"); \ 19 } 20 21 guest_bitop(set_bit) 22 guest_bitop(clear_bit) 23 guest_bitop(change_bit) 24 25 #undef guest_bitop 26 27 guest_testop(test_and_set_bit) 28 guest_testop(test_and_clear_bit) 29 guest_testop(test_and_change_bit) 30 31 #undef guest_testop 32 33 #define guest_test_bit(d, nr, p) ((void)(d), test_bit(nr, p)) 34 35 #endif /* __ASM_RISCV_GUEST_ATOMICS_H */ 36 37 /* 38 * Local variables: 39 * mode: C 40 * c-file-style: "BSD" 41 * c-basic-offset: 4 42 * indent-tabs-mode: nil 43 * End: 44 */ 45