aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/compiler.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-08-15 16:31:47 -0700
committerRichard Henderson <richard.henderson@linaro.org>2018-10-18 19:46:36 -0700
commite6cd4bb59b8154fa00da611200beef7eb4e8ec56 (patch)
tree092a1f3d8da6fe618602199eb7af7a6f65aa1950 /include/qemu/compiler.h
parent383beda9cf32f795616c3b93f7d6154d70372d4b (diff)
downloadqemu-e6cd4bb59b8154fa00da611200beef7eb4e8ec56.zip
qemu-e6cd4bb59b8154fa00da611200beef7eb4e8ec56.tar.gz
qemu-e6cd4bb59b8154fa00da611200beef7eb4e8ec56.tar.bz2
tcg: Split CONFIG_ATOMIC128
GCC7+ will no longer advertise support for 16-byte __atomic operations if only cmpxchg is supported, as for x86_64. Fortunately, x86_64 still has support for __sync_compare_and_swap_16 and we can make use of that. AArch64 does not have, nor ever has had such support, so open-code it. Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/qemu/compiler.h')
-rw-r--r--include/qemu/compiler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 66f8c24..6b92710 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -146,6 +146,17 @@
# define QEMU_FLATTEN
#endif
+/*
+ * If __attribute__((error)) is present, use it to produce an error at
+ * compile time. Otherwise, one must wait for the linker to diagnose
+ * the missing symbol.
+ */
+#if __has_attribute(error)
+# define QEMU_ERROR(X) __attribute__((error(X)))
+#else
+# define QEMU_ERROR(X)
+#endif
+
/* Implement C11 _Generic via GCC builtins. Example:
*
* QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x)