[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 24/27] tcg: Split out tcg/debug-assert.h
From: |
Richard Henderson |
Subject: |
[PATCH 24/27] tcg: Split out tcg/debug-assert.h |
Date: |
Sat, 20 May 2023 09:26:31 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/tcg/debug-assert.h | 17 +++++++++++++++++
include/tcg/tcg.h | 9 +--------
2 files changed, 18 insertions(+), 8 deletions(-)
create mode 100644 include/tcg/debug-assert.h
diff --git a/include/tcg/debug-assert.h b/include/tcg/debug-assert.h
new file mode 100644
index 0000000000..596765a3d2
--- /dev/null
+++ b/include/tcg/debug-assert.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Define tcg_debug_assert
+ * Copyright (c) 2008 Fabrice Bellard
+ */
+
+#ifndef TCG_DEBUG_ASSERT_H
+#define TCG_DEBUG_ASSERT_H
+
+#if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS
+# define tcg_debug_assert(X) do { assert(X); } while (0)
+#else
+# define tcg_debug_assert(X) \
+ do { if (!(X)) { __builtin_unreachable(); } } while (0)
+#endif
+
+#endif
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index cd6327b175..072c35f7f5 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -34,6 +34,7 @@
#include "tcg/tcg-mo.h"
#include "tcg-target.h"
#include "tcg/tcg-cond.h"
+#include "tcg/debug-assert.h"
/* XXX: make safe guess about sizes */
#define MAX_OP_PER_INSTR 266
@@ -222,14 +223,6 @@ typedef uint64_t tcg_insn_unit;
/* The port better have done this. */
#endif
-
-#if defined CONFIG_DEBUG_TCG || defined QEMU_STATIC_ANALYSIS
-# define tcg_debug_assert(X) do { assert(X); } while (0)
-#else
-# define tcg_debug_assert(X) \
- do { if (!(X)) { __builtin_unreachable(); } } while (0)
-#endif
-
typedef struct TCGRelocation TCGRelocation;
struct TCGRelocation {
QSIMPLEQ_ENTRY(TCGRelocation) next;
--
2.34.1
- Re: [PATCH 17/27] target/s390x: Use cpu_{ld,st}*_mmu in do_csst, (continued)
- [PATCH 20/27] accel/tcg: Remove prot argument to atomic_mmu_lookup, Richard Henderson, 2023/05/20
- [PATCH 21/27] accel/tcg: Eliminate #if on HAVE_ATOMIC128 and HAVE_CMPXCHG128, Richard Henderson, 2023/05/20
- [PATCH 22/27] qemu/atomic128: Split atomic16_read, Richard Henderson, 2023/05/20
- [PATCH 23/27] accel/tcg: Correctly use atomic128.h in ldst_atomicity.c.inc, Richard Henderson, 2023/05/20
- [PATCH 25/27] qemu/atomic128: Improve cmpxchg fallback for atomic16_set, Richard Henderson, 2023/05/20
- [PATCH 18/27] target/s390x: Always use cpu_atomic_cmpxchgl_be_mmu in do_csst, Richard Henderson, 2023/05/20
- [PATCH 24/27] tcg: Split out tcg/debug-assert.h,
Richard Henderson <=
- [PATCH 27/27] qemu/atomic128: Add x86_64 atomic128-ldst.h, Richard Henderson, 2023/05/20
- [PATCH 26/27] qemu/atomic128: Add runtime test for FEAT_LSE2, Richard Henderson, 2023/05/20