mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-03 15:55:37 +00:00
target/arm: Use helper_retaddr in stxp helpers
We use raw memory primitives along the !parallel_cpus paths in order to simplify the endianness handling. Because of that, we did not benefit from the generic changes to cpu_ldst_user_only_template.h. The simplest fix is to manipulate helper_retaddr here. Backports commit 3bdb5fcc9a08a9a47ce30c4e0c2d64c95190b49d from qemu
This commit is contained in:
parent
f76eb22a46
commit
a58eb310eb
|
@ -196,7 +196,7 @@ struct uc_struct {
|
|||
CPUState *tcg_current_rr_cpu;
|
||||
|
||||
// qemu/user-exec.c
|
||||
QEMU_THREAD_LOCAL_VAR helper_retaddr;
|
||||
uintptr_t helper_retaddr;
|
||||
|
||||
// qemu/memory.c
|
||||
bool global_dirty_log;
|
||||
|
|
|
@ -524,6 +524,9 @@ uint64_t HELPER(paired_cmpxchg64_le)(CPUARMState *env, uint64_t addr,
|
|||
#ifdef CONFIG_USER_ONLY
|
||||
/* ??? Enforce alignment. */
|
||||
uint64_t *haddr = g2h(addr);
|
||||
|
||||
env->uc->helper_retaddr = ra;
|
||||
|
||||
o0 = ldq_le_p(haddr + 0);
|
||||
o1 = ldq_le_p(haddr + 1);
|
||||
oldv = int128_make128(o0, o1);
|
||||
|
@ -533,6 +536,7 @@ uint64_t HELPER(paired_cmpxchg64_le)(CPUARMState *env, uint64_t addr,
|
|||
stq_le_p(haddr + 0, int128_getlo(newv));
|
||||
stq_le_p(haddr + 1, int128_gethi(newv));
|
||||
}
|
||||
env->uc->helper_retaddr = 0;
|
||||
#else
|
||||
int mem_idx = cpu_mmu_index(env, false);
|
||||
TCGMemOpIdx oi0 = make_memop_idx(MO_LEQ | MO_ALIGN_16, mem_idx);
|
||||
|
@ -578,6 +582,9 @@ uint64_t HELPER(paired_cmpxchg64_be)(CPUARMState *env, uint64_t addr,
|
|||
#ifdef CONFIG_USER_ONLY
|
||||
/* ??? Enforce alignment. */
|
||||
uint64_t *haddr = g2h(addr);
|
||||
|
||||
env->uc->helper_retaddr = ra;
|
||||
|
||||
o1 = ldq_be_p(haddr + 0);
|
||||
o0 = ldq_be_p(haddr + 1);
|
||||
oldv = int128_make128(o0, o1);
|
||||
|
@ -587,6 +594,7 @@ uint64_t HELPER(paired_cmpxchg64_be)(CPUARMState *env, uint64_t addr,
|
|||
stq_be_p(haddr + 0, int128_gethi(newv));
|
||||
stq_be_p(haddr + 1, int128_getlo(newv));
|
||||
}
|
||||
env->uc->helper_retaddr = 0;
|
||||
#else
|
||||
int mem_idx = cpu_mmu_index(env, false);
|
||||
TCGMemOpIdx oi0 = make_memop_idx(MO_BEQ | MO_ALIGN_16, mem_idx);
|
||||
|
|
Loading…
Reference in a new issue