]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
accel/tcg: Make cpu-exec-common.c a target agnostic unit
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 14 Sep 2023 18:57:17 +0000 (20:57 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 4 Oct 2023 18:03:54 +0000 (11:03 -0700)
cpu_in_serial_context() is not target specific,
move it declaration to "internal-common.h" (which
we include in the 4 source files modified).

Remove the unused "exec/exec-all.h" header from
cpu-exec-common.c.  There is no more target specific
code in this file: make it target agnostic.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230914185718.76241-12-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/cpu-exec-common.c
accel/tcg/cputlb.c
accel/tcg/internal-common.h
accel/tcg/internal-target.h
accel/tcg/meson.build
accel/tcg/tb-maint.c
accel/tcg/user-exec.c

index a9f9dc2c565237405d01e397441d34c8bc9dfb89..bc9b1a260e824db9fe6692d5cf20e286fcc3742c 100644 (file)
@@ -20,9 +20,8 @@
 #include "qemu/osdep.h"
 #include "sysemu/cpus.h"
 #include "sysemu/tcg.h"
-#include "exec/exec-all.h"
 #include "qemu/plugin.h"
-#include "internal-target.h"
+#include "internal-common.h"
 
 bool tcg_allowed;
 
index df20bf403467b367d17fa75dca2b2398a5edda4a..b8c5e345b802ddbdc082135850de177398da7fbb 100644 (file)
@@ -35,6 +35,7 @@
 #include "exec/translate-all.h"
 #include "trace.h"
 #include "tb-hash.h"
+#include "internal-common.h"
 #include "internal-target.h"
 #ifdef CONFIG_PLUGIN
 #include "qemu/plugin-memory.h"
index 5d5247442e14bbc2166bac10cce80a8f65a12878..3b2277e6e905f6b5cbf3290e9a6a0e6890f6649e 100644 (file)
@@ -9,9 +9,20 @@
 #ifndef ACCEL_TCG_INTERNAL_COMMON_H
 #define ACCEL_TCG_INTERNAL_COMMON_H
 
+#include "exec/translation-block.h"
+
 extern int64_t max_delay;
 extern int64_t max_advance;
 
 void dump_exec_info(GString *buf);
 
+/*
+ * Return true if CS is not running in parallel with other cpus, either
+ * because there are no other cpus or we are within an exclusive context.
+ */
+static inline bool cpu_in_serial_context(CPUState *cs)
+{
+    return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
+}
+
 #endif
index 17e3ad7054587aae2f0e151e3c4bb7f62c50f402..4e36cf858e9848a5027f388f132285287f25f4ec 100644 (file)
@@ -93,15 +93,6 @@ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
     }
 }
 
-/*
- * Return true if CS is not running in parallel with other cpus, either
- * because there are no other cpus or we are within an exclusive context.
- */
-static inline bool cpu_in_serial_context(CPUState *cs)
-{
-    return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
-}
-
 extern bool one_insn_per_tb;
 
 /**
index 4633a34d28eb15c731c9df6513062597621d10fc..8783edd06ee578d0332852901c92bf7ccc1e6d70 100644 (file)
@@ -1,7 +1,9 @@
 tcg_ss = ss.source_set()
+common_ss.add(when: 'CONFIG_TCG', if_true: files(
+  'cpu-exec-common.c',
+))
 tcg_ss.add(files(
   'tcg-all.c',
-  'cpu-exec-common.c',
   'cpu-exec.c',
   'tb-maint.c',
   'tcg-runtime-gvec.c',
index 290d94e8c2cc9791436e9dcc90b3785f29d9d762..e678d20dc208e25f9b9683b732e5f62c3af2e5c3 100644 (file)
@@ -29,6 +29,7 @@
 #include "tcg/tcg.h"
 #include "tb-hash.h"
 #include "tb-context.h"
+#include "internal-common.h"
 #include "internal-target.h"
 
 
index f925dd03057a3bf1e4ed21fa2ea5eb574fbd5a31..5bf2761bf48b68c035171139d09f5824278b5b1b 100644 (file)
@@ -29,6 +29,7 @@
 #include "qemu/atomic128.h"
 #include "trace/trace-root.h"
 #include "tcg/tcg-ldst.h"
+#include "internal-common.h"
 #include "internal-target.h"
 
 __thread uintptr_t helper_retaddr;