aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-03-04 22:10:26 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-03-04 22:10:26 +0000
commite47e1b661a44f1183db6ee9a7cb3a5cdd5cf61f4 (patch)
tree239a8187b193ec0db28f47f5a3004484de9f5a08
parentdea945469e9370a2007dcbacce42b82677dbe809 (diff)
parentf1242f942e7b79ca0445bc1172f1788cd968dc64 (diff)
downloadaemu-simpleperf-release.tar.gz
Snap for 11526323 from f1242f942e7b79ca0445bc1172f1788cd968dc64 to simpleperf-releasesimpleperf-release
Change-Id: If6e565ade6f52921911da43b94da4d28ff354076
-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