[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 23/30] target-arm: add atomic_xchg helper
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [RFC 23/30] target-arm: add atomic_xchg helper |
Date: |
Mon, 27 Jun 2016 15:02:09 -0400 |
Signed-off-by: Emilio G. Cota <address@hidden>
---
target-arm/helper.c | 10 ++++++++++
target-arm/helper.h | 3 +++
2 files changed, 13 insertions(+)
diff --git a/target-arm/helper.c b/target-arm/helper.c
index b38bfbd..adab296 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -9444,3 +9444,13 @@ uint32_t HELPER(cmpxchgq)(CPUARMState *env, uint32_t
addr, uint64_t old,
read = cpu_cmpxchgq_data_ra(env, addr, old, new, GETPC());
return read != old;
}
+
+uint32_t HELPER(atomic_xchgb)(CPUARMState *env, uint32_t addr, uint32_t val)
+{
+ return cpu_atomic_xchgb_data_ra(env, addr, val, GETPC());
+}
+
+uint32_t HELPER(atomic_xchgl)(CPUARMState *env, uint32_t addr, uint32_t val)
+{
+ return cpu_atomic_xchgl_data_ra(env, addr, val, GETPC());
+}
diff --git a/target-arm/helper.h b/target-arm/helper.h
index f3d6f26..7a36bb3 100644
--- a/target-arm/helper.h
+++ b/target-arm/helper.h
@@ -542,6 +542,9 @@ DEF_HELPER_4(cmpxchgw, i32, env, i32, i64, i32)
DEF_HELPER_4(cmpxchgl, i32, env, i32, i64, i32)
DEF_HELPER_5(cmpxchgq, i32, env, i32, i64, i32, i32)
+DEF_HELPER_3(atomic_xchgb, i32, env, i32, i32)
+DEF_HELPER_3(atomic_xchgl, i32, env, i32, i32)
+
#ifdef TARGET_AARCH64
#include "helper-a64.h"
#endif
--
2.5.0
- [Qemu-devel] [RFC 14/30] target-i386: emulate LOCK'ed NOT using atomic helper, (continued)
- [Qemu-devel] [RFC 14/30] target-i386: emulate LOCK'ed NOT using atomic helper, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 10/30] cpu_ldst: add cpu_atomic helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 11/30] target-i386: add atomic helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 06/30] target-i386: emulate LOCK'ed cmpxchg8b/16b using cmpxchg helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 05/30] target-i386: emulate LOCK'ed cmpxchg using cmpxchg helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 13/30] target-i386: emulate LOCK'ed INC using atomic helper, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 15/30] target-i386: emulate LOCK'ed NEG using cmpxchg helper, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 27/30] target-arm: emulate aarch64's LL/SC using cmpxchg helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 25/30] helper: add DEF_HELPER_6, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 16/30] target-i386: emulate LOCK'ed XADD using atomic helper, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 23/30] target-arm: add atomic_xchg helper,
Emilio G. Cota <=
- [Qemu-devel] [RFC 22/30] target-arm: emulate LL/SC using cmpxchg helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 29/30] linux-user: remove handling of aarch64's EXCP_STREX, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 20/30] target-i386: remove helper_lock(), Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 26/30] target-arm: add cmpxchg helpers for aarch64, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 17/30] target-i386: emulate LOCK'ed BTX ops using atomic helpers, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 24/30] target-arm: emulate SWP with atomic_xchg helper, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 30/30] target-arm: remove EXCP_STREX + cpu_exclusive_{test, info}, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 18/30] target-i386: emulate XCHG using atomic helper, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 28/30] linux-user: remove handling of ARM's EXCP_STREX, Emilio G. Cota, 2016/06/27
- [Qemu-devel] [RFC 21/30] target-arm: add cmpxchg helpers, Emilio G. Cota, 2016/06/27