aboutsummaryrefslogtreecommitdiff
path: root/host/include
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-05-19 18:02:19 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-05-23 18:54:55 -0700
commit4deb39ebb33d97e2ad5466e1b5b5e7c50ad83a0a (patch)
tree010ff8d0d09d153a44c9134db66fa6c0e2974208 /host/include
parent7bedee3243b995281837a30ae7bf8982b4fd570c (diff)
accel/tcg: Eliminate #if on HAVE_ATOMIC128 and HAVE_CMPXCHG128
These symbols will shortly become dynamic runtime tests and therefore not appropriate for the preprocessor. Use the matching CONFIG_* symbols for that purpose. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'host/include')
-rw-r--r--host/include/aarch64/host/atomic128-cas.h2
-rw-r--r--host/include/generic/host/atomic128-ldst.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/host/include/aarch64/host/atomic128-cas.h b/host/include/aarch64/host/atomic128-cas.h
index 80de58e06d..58630107bc 100644
--- a/host/include/aarch64/host/atomic128-cas.h
+++ b/host/include/aarch64/host/atomic128-cas.h
@@ -37,6 +37,8 @@ static inline Int128 atomic16_cmpxchg(Int128 *ptr, Int128 cmp, Int128 new)
return int128_make128(oldl, oldh);
}
+
+# define CONFIG_CMPXCHG128 1
# define HAVE_CMPXCHG128 1
#endif
diff --git a/host/include/generic/host/atomic128-ldst.h b/host/include/generic/host/atomic128-ldst.h
index 46911dfb61..06a62e9dd0 100644
--- a/host/include/generic/host/atomic128-ldst.h
+++ b/host/include/generic/host/atomic128-ldst.h
@@ -33,7 +33,7 @@ atomic16_set(Int128 *ptr, Int128 val)
}
# define HAVE_ATOMIC128 1
-#elif !defined(CONFIG_USER_ONLY) && HAVE_CMPXCHG128
+#elif defined(CONFIG_CMPXCHG128) && !defined(CONFIG_USER_ONLY)
static inline Int128 ATTRIBUTE_ATOMIC128_OPT
atomic16_read(Int128 *ptr)
{