newlib: implement 8/16-bit atomic operations for riscv

This commit is contained in:
Alexey Lapshin
2023-01-31 23:19:21 +07:00
parent 8849b1b5aa
commit a32bbedcd9
3 changed files with 675 additions and 0 deletions

View File

@@ -434,6 +434,18 @@ ATOMIC_STORE(1, unsigned char)
ATOMIC_STORE(2, short unsigned int)
ATOMIC_STORE(4, unsigned int)
#elif __riscv_atomic == 1
bool CLANG_ATOMIC_SUFFIX(__atomic_always_lock_free) (unsigned int size, const volatile void *) {
return size <= sizeof(int);
}
CLANG_DECLARE_ALIAS( __atomic_always_lock_free)
bool CLANG_ATOMIC_SUFFIX(__atomic_is_lock_free) (unsigned int size, const volatile void *) {
return size <= sizeof(int);
}
CLANG_DECLARE_ALIAS( __atomic_is_lock_free)
#endif // !HAS_ATOMICS_32
#if !HAS_ATOMICS_64