aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-03-01 00:35:31 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-03-01 00:35:31 +0000
commitb9209ed8875d002b4e2afc6ea18e73f7ebb9948c (patch)
tree239a8187b193ec0db28f47f5a3004484de9f5a08
parent54903471035b2442dc3a9bc147b95b7663cd554c (diff)
parentf1242f942e7b79ca0445bc1172f1788cd968dc64 (diff)
downloadaemu-emu-34-3-release.tar.gz
Snap for 11518112 from f1242f942e7b79ca0445bc1172f1788cd968dc64 to emu-34-3-releaseemu-34-3-release
Change-Id: I297e5c24b25b463261c9da0644771a6e20bfaf89
-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