diff options
author | Emilio G. Cota <cota@braap.org> | 2016-06-27 15:01:51 -0400 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2016-10-26 08:29:01 -0700 |
commit | ae03f8de45427042ecd10b0941a005f21ecc064c (patch) | |
tree | c3f96a2815553b63ed80dfae9d25ceaeab751d60 /target-i386/helper.h | |
parent | 91682118aa330aff7e8ef0cc685c32d101f49940 (diff) |
target-i386: emulate LOCK'ed cmpxchg using cmpxchg helpers
The diff here is uglier than necessary. All this does is to turn
FOO
into:
if (s->prefix & PREFIX_LOCK) {
BAR
} else {
FOO
}
where FOO is the original implementation of an unlocked cmpxchg.
[rth: Adjust unlocked cmpxchg to use movcond instead of branches.
Adjust helpers to use atomic helpers.]
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1467054136-10430-6-git-send-email-cota@braap.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-i386/helper.h')
-rw-r--r-- | target-i386/helper.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/target-i386/helper.h b/target-i386/helper.h index 1320edc016..729d4b63da 100644 --- a/target-i386/helper.h +++ b/target-i386/helper.h @@ -74,8 +74,10 @@ DEF_HELPER_3(boundw, void, env, tl, int) DEF_HELPER_3(boundl, void, env, tl, int) DEF_HELPER_1(rsm, void, env) DEF_HELPER_2(into, void, env, int) +DEF_HELPER_2(cmpxchg8b_unlocked, void, env, tl) DEF_HELPER_2(cmpxchg8b, void, env, tl) #ifdef TARGET_X86_64 +DEF_HELPER_2(cmpxchg16b_unlocked, void, env, tl) DEF_HELPER_2(cmpxchg16b, void, env, tl) #endif DEF_HELPER_1(single_step, void, env) |