Commit 3c5f9c3f authored by Richard Henderson's avatar Richard Henderson
Browse files

target/arm: Fix GETPC usage in do_paired_cmpxchg64_l/be



Use of GETPC must be restricted to those functions that are
directly called from TCG generated code.

Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Fixes: 2399d4e7
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 3bdb5fcc
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -432,9 +432,8 @@ uint64_t HELPER(crc32c_64)(uint64_t acc, uint64_t val, uint32_t bytes)
/* Returns 0 on success; 1 otherwise.  */
static uint64_t do_paired_cmpxchg64_le(CPUARMState *env, uint64_t addr,
                                       uint64_t new_lo, uint64_t new_hi,
                                       bool parallel)
                                       bool parallel, uintptr_t ra)
{
    uintptr_t ra = GETPC();
    Int128 oldv, cmpv, newv;
    bool success;

@@ -491,20 +490,19 @@ static uint64_t do_paired_cmpxchg64_le(CPUARMState *env, uint64_t addr,
uint64_t HELPER(paired_cmpxchg64_le)(CPUARMState *env, uint64_t addr,
                                              uint64_t new_lo, uint64_t new_hi)
{
    return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, false);
    return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, false, GETPC());
}

uint64_t HELPER(paired_cmpxchg64_le_parallel)(CPUARMState *env, uint64_t addr,
                                              uint64_t new_lo, uint64_t new_hi)
{
    return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, true);
    return do_paired_cmpxchg64_le(env, addr, new_lo, new_hi, true, GETPC());
}

static uint64_t do_paired_cmpxchg64_be(CPUARMState *env, uint64_t addr,
                                       uint64_t new_lo, uint64_t new_hi,
                                       bool parallel)
                                       bool parallel, uintptr_t ra)
{
    uintptr_t ra = GETPC();
    Int128 oldv, cmpv, newv;
    bool success;

@@ -561,11 +559,11 @@ static uint64_t do_paired_cmpxchg64_be(CPUARMState *env, uint64_t addr,
uint64_t HELPER(paired_cmpxchg64_be)(CPUARMState *env, uint64_t addr,
                                     uint64_t new_lo, uint64_t new_hi)
{
    return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, false);
    return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, false, GETPC());
}

uint64_t HELPER(paired_cmpxchg64_be_parallel)(CPUARMState *env, uint64_t addr,
                                     uint64_t new_lo, uint64_t new_hi)
{
    return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, true);
    return do_paired_cmpxchg64_be(env, addr, new_lo, new_hi, true, GETPC());
}