aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/include/aemu/base/synchronization/Lock.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/base/include/aemu/base/synchronization/Lock.h b/base/include/aemu/base/synchronization/Lock.h
index 2b88f05..281a970 100644
--- a/base/include/aemu/base/synchronization/Lock.h
+++ b/base/include/aemu/base/synchronization/Lock.h
@@ -237,6 +237,8 @@ static inline __attribute__((always_inline)) void SmpWmb() {
asm volatile("dmb ishst" ::: "memory");
#elif defined(__x86_64__)
std::atomic_thread_fence(std::memory_order_release);
+#elif defined(__riscv) && (__riscv_xlen == 64)
+ std::atomic_thread_fence(std::memory_order_release);
#else
#error "Unimplemented SmpWmb for current CPU architecture"
#endif
@@ -247,6 +249,8 @@ static inline __attribute__((always_inline)) void SmpRmb() {
asm volatile("dmb ishld" ::: "memory");
#elif defined(__x86_64__)
std::atomic_thread_fence(std::memory_order_acquire);
+#elif defined(__riscv) && (__riscv_xlen == 64)
+ std::atomic_thread_fence(std::memory_order_acquire);
#else
#error "Unimplemented SmpRmb for current CPU architecture"
#endif