]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qemu-common: Move tcg_enabled() etc. to sysemu/tcg.h
authorMarkus Armbruster <armbru@redhat.com>
Thu, 23 May 2019 14:35:05 +0000 (16:35 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 11 Jun 2019 18:22:09 +0000 (20:22 +0200)
Other accelerators have their own headers: sysemu/hax.h, sysemu/hvf.h,
sysemu/kvm.h, sysemu/whpx.h.  Only tcg_enabled() & friends sit in
qemu-common.h.  This necessitates inclusion of qemu-common.h into
headers, which is against the rules spelled out in qemu-common.h's
file comment.

Move tcg_enabled() & friends into their own header sysemu/tcg.h, and
adjust #include directives.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190523143508.25387-2-armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[Rebased with conflicts resolved automatically, except for
accel/tcg/tcg-all.c]

33 files changed:
MAINTAINERS
accel/tcg/cpu-exec-common.c
accel/tcg/tcg-all.c
accel/tcg/translate-all.c
bsd-user/main.c
cpus.c
exec.c
hw/i386/pc.c
hw/ppc/spapr_caps.c
hw/s390x/ipl.c
include/exec/ram_addr.h
include/qemu-common.h
include/sysemu/tcg.h [new file with mode: 0644]
linux-user/main.c
memory.c
monitor.c
qemu-nbd.c
qom/cpu.c
target/arm/cpu.c
target/i386/cpu.c
target/i386/cpu.h
target/i386/helper.c
target/i386/machine.c
target/ppc/translate_init.inc.c
target/s390x/cpu.c
target/s390x/cpu_models.c
target/s390x/gdbstub.c
target/s390x/helper.c
target/s390x/interrupt.c
target/s390x/machine.c
target/s390x/mmu_helper.c
target/s390x/sigp.c
vl.c

index 7be122541583043723a2c0754d63469e7ce4f1e4..ef00e8a70dbf3fcc7afe13cc811eba74df561483 100644 (file)
@@ -125,6 +125,7 @@ F: include/exec/exec-all.h
 F: include/exec/helper*.h
 F: include/exec/tb-hash.h
 F: include/sysemu/cpus.h
+F: include/sysemu/tcg.h
 
 FPU emulation
 M: Aurelien Jarno <aurelien@aurel32.net>
index 462a1f1865a7c05d324b9611827c0685499a323a..12c1e3e9744839503f2f8525dc3fb5df959c6969 100644 (file)
@@ -20,6 +20,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "sysemu/cpus.h"
+#include "sysemu/tcg.h"
 #include "exec/exec-all.h"
 
 bool tcg_allowed;
index 9b215dcc5a8607a638afca8378606f637a20857b..c92d4c82eddf3262b009b43f8b8336c00b7bc572 100644 (file)
@@ -26,8 +26,8 @@
 #include "qemu/osdep.h"
 #include "sysemu/accel.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "qom/object.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "sysemu/cpus.h"
 #include "qemu/main-loop.h"
index e24ee3a1722603bfb6d5c879a5a855a8cd9ccfac..5d97a2a6514081ebdcfd5e01970542f1f620e671 100644 (file)
@@ -16,9 +16,9 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 
-#include "qemu-common.h"
 #define NO_CPU_IO_DEFS
 #include "cpu.h"
 #include "trace.h"
@@ -55,6 +55,7 @@
 #include "qemu/main-loop.h"
 #include "exec/log.h"
 #include "sysemu/cpus.h"
+#include "sysemu/tcg.h"
 
 /* #define DEBUG_TB_INVALIDATE */
 /* #define DEBUG_TB_FLUSH */
index c473a99153df526961c3d89d169a0d0e87a3d98d..7d4abd20ed3ff1536bfa6929647c4e879dd2daf5 100644 (file)
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/tcg.h"
 #include "qemu-version.h"
 #include <machine/trap.h>
 
diff --git a/cpus.c b/cpus.c
index 111ca4ed1cdb6dd94282b798863e6063b9b5d0cf..5d7be0c5a2b0781d07f23394a2b638eed48a5440 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -33,6 +33,7 @@
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "sysemu/block-backend.h"
 #include "exec/gdbstub.h"
 #include "sysemu/dma.h"
diff --git a/exec.c b/exec.c
index 4e734770c20fe1a0a9b5b28d4a56b4d90f50ff0a..0bc59e9a30d1024b3109ae542a80a4b618a39c92 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -16,6 +16,7 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 
@@ -32,6 +33,7 @@
 #endif
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "qemu/timer.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
index 1b08b56362251cf43b208017a72ffdc5f64089d4..2c5446b0951e32ce6cb0e26dd8f468926a43fd07 100644 (file)
@@ -50,6 +50,7 @@
 #include "hw/pci/msi.h"
 #include "hw/sysbus.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "sysemu/numa.h"
 #include "sysemu/kvm.h"
 #include "sysemu/qtest.h"
index 31b466139975c5a7e99af5f41f8095bcbbb6e2fa..bbb001f84a47ae1016e9c5638b76238ff2687c10 100644 (file)
@@ -21,6 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "qapi/error.h"
@@ -32,6 +33,7 @@
 #include "cpu-models.h"
 #include "kvm_ppc.h"
 #include "sysemu/qtest.h"
+#include "sysemu/tcg.h"
 
 #include "hw/ppc/spapr.h"
 
index b93750c14eacdb9a7bc855bfc92605486edba3b2..1f3aef051b3d6b5304b469dd80cddea356cb64b9 100644 (file)
@@ -14,6 +14,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "cpu.h"
 #include "elf.h"
 #include "hw/loader.h"
index 139ad79390fa6f959e145fcbe9a68d81ae2506ed..f96777bb992198f1952d7c08849eceb2d3edf6dd 100644 (file)
@@ -21,6 +21,7 @@
 
 #ifndef CONFIG_USER_ONLY
 #include "hw/xen/xen.h"
+#include "sysemu/tcg.h"
 #include "exec/ramlist.h"
 
 struct RAMBlock {
index f891e05e7e5dc40f6612be28e1ea01b63f109ecf..d7f4a4e7eb2c5fe92a40e36fc03f72bd7a76ca0d 100644 (file)
@@ -77,14 +77,6 @@ int qemu_openpty_raw(int *aslave, char *pty_name);
     sendto(sockfd, buf, len, flags, destaddr, addrlen)
 #endif
 
-extern bool tcg_allowed;
-void tcg_exec_init(unsigned long tb_size);
-#ifdef CONFIG_TCG
-#define tcg_enabled() (tcg_allowed)
-#else
-#define tcg_enabled() 0
-#endif
-
 void cpu_exec_init_all(void);
 void cpu_exec_step_atomic(CPUState *cpu);
 
diff --git a/include/sysemu/tcg.h b/include/sysemu/tcg.h
new file mode 100644 (file)
index 0000000..7d116d2
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * QEMU TCG support
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef SYSEMU_TCG_H
+#define SYSEMU_TCG_H
+
+extern bool tcg_allowed;
+void tcg_exec_init(unsigned long tb_size);
+#ifdef CONFIG_TCG
+#define tcg_enabled() (tcg_allowed)
+#else
+#define tcg_enabled() 0
+#endif
+
+#endif
index 97ca22bb042b3e7200218e67e7afc73005ecf991..a2b4a9f3e29f669284e653d53fdefbde5d36e94f 100644 (file)
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/tcg.h"
 #include "qemu-version.h"
 #include <sys/syscall.h>
 #include <sys/resource.h>
index 0920c105aa22f525b953e33cb22b693cb7c3efaa..0a089a73ae1a409d314cb84384490951d83a5e32 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -15,7 +15,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
@@ -30,6 +29,7 @@
 #include "exec/ram_addr.h"
 #include "sysemu/kvm.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "hw/qdev-properties.h"
 #include "migration/vmstate.h"
 
index 6428eb3b7ea4f0a064979946ee838a5374319bdb..3650ceb57464c2fe4cfaad74417e06aae937c3da 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -53,6 +53,7 @@
 #include "sysemu/hw_accel.h"
 #include "authz/list.h"
 #include "qapi/util.h"
+#include "sysemu/tcg.h"
 #include "sysemu/tpm.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qerror.h"
index 081fcf74d5c95311c28a3a47c033ccf016f9b21e..25ce71e1600359143d869cc2b9e81d53c1f2d9aa 100644 (file)
@@ -21,6 +21,7 @@
 #include <libgen.h>
 #include <pthread.h>
 
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qemu/cutils.h"
 #include "sysemu/block-backend.h"
index 6b4632abda30d5b3f901c3cf9de678a9a4b00a38..f376f782d8395de4e2b273a72173b87a341cf82e 100644 (file)
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qom/cpu.h"
 #include "sysemu/hw_accel.h"
 #include "qemu/notify.h"
@@ -30,6 +29,7 @@
 #include "qemu/error-report.h"
 #include "qemu/qemu-print.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "hw/boards.h"
 #include "hw/qdev-properties.h"
 #include "trace-root.h"
index f70e07fd11852f7700201ffbf1ec5c00a316506f..c2dff10f82057d7583bb24e425381d3b539868fd 100644 (file)
 #include "qapi/visitor.h"
 #include "cpu.h"
 #include "internals.h"
-#include "qemu-common.h"
 #include "exec/exec-all.h"
 #include "hw/qdev-properties.h"
 #if !defined(CONFIG_USER_ONLY)
 #include "hw/loader.h"
 #endif
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "sysemu/hw_accel.h"
 #include "kvm_arm.h"
 #include "disas/capstone.h"
index b21ecaac17d873b854b02c1bc513468654aaadbe..a4bc04ed1dc33309a0af9b9ceaafe190647bee2b 100644 (file)
@@ -47,6 +47,7 @@
 #include "standard-headers/asm-x86/kvm_para.h"
 
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "hw/qdev-properties.h"
 #include "hw/i386/topology.h"
 #ifndef CONFIG_USER_ONLY
index edad6e1efb7fe6ac5c3c5b343c27e425b56e829b..0732e059ec98993eaf48200625169962fd3c137c 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef I386_CPU_H
 #define I386_CPU_H
 
-#include "qemu-common.h"
+#include "sysemu/tcg.h"
 #include "cpu-qom.h"
 #include "hyperv-proto.h"
 #include "exec/cpu-defs.h"
index ff3a60c7cff8f58f5b4f764c2d6d95890239ad7e..23024926acf3534bfdde777d1e0c26cf4e336bc1 100644 (file)
@@ -25,6 +25,7 @@
 #include "kvm_i386.h"
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "sysemu/hw_accel.h"
 #include "monitor/monitor.h"
 #include "hw/i386/apic_internal.h"
index 225b5d433bc446f8d81a9de5344cd4303373cadd..1150967b9739ffe97ad26d00eff3f8cc4b3682fe 100644 (file)
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "hw/hw.h"
@@ -10,6 +9,7 @@
 #include "hyperv.h"
 
 #include "sysemu/kvm.h"
+#include "sysemu/tcg.h"
 
 #include "qemu/error-report.h"
 
index b71b7bac20a94fbb63f874afbf99d426cf6bb1aa..970171b11690aafc80ec31227a295083b94d1d88 100644 (file)
@@ -24,6 +24,7 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/cpus.h"
 #include "sysemu/hw_accel.h"
+#include "sysemu/tcg.h"
 #include "cpu-models.h"
 #include "mmu-hash32.h"
 #include "mmu-hash64.h"
index 4ca66fed1a8fec627a9b77a3c94509a808ef1fe3..c80743a923746ad250e544dbd403dee27b5b6d4c 100644 (file)
@@ -26,7 +26,6 @@
 #include "internal.h"
 #include "kvm_s390x.h"
 #include "sysemu/kvm.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "trace.h"
@@ -39,6 +38,7 @@
 #include "hw/hw.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #endif
 #include "fpu/softfloat.h"
 
index b5d16e4c8966dbbf80b982114f22db3417719b07..3fce8114deeda3d6ab984c0a31794c19896ab478 100644 (file)
@@ -15,6 +15,7 @@
 #include "internal.h"
 #include "kvm_s390x.h"
 #include "sysemu/kvm.h"
+#include "sysemu/tcg.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "qemu/error-report.h"
index a45d805a21d31f65b55e308b7801229a8f051c6f..e24a49f4a915f6c3e8a5db8a858e8dd76d53bb96 100644 (file)
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
+
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "internal.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
 #include "qemu/bitops.h"
 #include "sysemu/hw_accel.h"
+#include "sysemu/tcg.h"
 
 int s390_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
 {
index 52a11daeaea19ac05a14c05413dd9a59334056e9..13ae9909ad1ea57fee4ea94f87e2b3aa203be06e 100644 (file)
@@ -28,6 +28,7 @@
 #include "sysemu/hw_accel.h"
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #endif
 
 #ifndef CONFIG_USER_ONLY
index a8f9b387956dbd3745cd4039ce3da944f8842184..a841f7187d758fe457cbcc6a0a6c98c26dd68f44 100644 (file)
@@ -14,6 +14,7 @@
 #include "internal.h"
 #include "exec/exec-all.h"
 #include "sysemu/kvm.h"
+#include "sysemu/tcg.h"
 #include "hw/s390x/ioinst.h"
 #include "tcg_s390x.h"
 #if !defined(CONFIG_USER_ONLY)
index e6851a57bcc68aa695b761b5bcb6995e3b594857..1e9526e937623897fe688c0fff7099ce57d5571d 100644 (file)
@@ -21,6 +21,7 @@
 #include "kvm_s390x.h"
 #include "tcg_s390x.h"
 #include "sysemu/kvm.h"
+#include "sysemu/tcg.h"
 
 static int cpu_post_load(void *opaque, int version_id)
 {
index 9669bae393ba6cfe1c66fa6668b09a0742b4dcda..6e9c4d6151bbe829a15826aa26124e66588255d7 100644 (file)
@@ -22,6 +22,7 @@
 #include "internal.h"
 #include "kvm_s390x.h"
 #include "sysemu/kvm.h"
+#include "sysemu/tcg.h"
 #include "exec/exec-all.h"
 #include "trace.h"
 #include "hw/s390x/storage-keys.h"
index ea5f69d5d862b42c8edac0f96fdba284c44461d6..ce49a792fcee8c6e8e9c6efede0eaf6b2ef477e4 100644 (file)
@@ -9,13 +9,13 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "cpu.h"
 #include "internal.h"
 #include "sysemu/hw_accel.h"
 #include "exec/address-spaces.h"
 #include "exec/exec-all.h"
 #include "sysemu/sysemu.h"
+#include "sysemu/tcg.h"
 #include "trace.h"
 #include "qapi/qapi-types-misc.h"
 
diff --git a/vl.c b/vl.c
index cd1fbc4cdc534f2c3b739571db9fd4f5e46281f8..efdfea26ee9f031225d7c98860cfea62e3364642 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -30,6 +30,7 @@
 #include "qemu/help_option.h"
 #include "qemu/uuid.h"
 #include "sysemu/seccomp.h"
+#include "sysemu/tcg.h"
 
 #ifdef CONFIG_SDL
 #if defined(__APPLE__) || defined(main)