Many architectures have arch-specific initialization functions that are called from CPU initialization at target-*/cpu.c.
Instead of requiring the CPU code to keep track of TCG initialization, let an arch-specific init function to be defined, and it will get called by tcg_exec_init(). Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- include/qemu-common.h | 1 + stubs/Makefile.objs | 1 + stubs/tcg.c | 5 +++++ translate-all.c | 1 + 4 files changed, 8 insertions(+) create mode 100644 stubs/tcg.c diff --git a/include/qemu-common.h b/include/qemu-common.h index f862214..5ea8070 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -269,6 +269,7 @@ typedef struct PCIHostDeviceAddress { void tcg_exec_init(unsigned long tb_size); bool tcg_enabled(void); +void tcg_arch_init(void); void cpu_exec_init_all(void); diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 5e347d0..240f270 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -40,3 +40,4 @@ stub-obj-$(CONFIG_WIN32) += fd-register.o stub-obj-y += cpus.o stub-obj-y += kvm.o stub-obj-y += qmp_pc_dimm_device_list.o +stub-obj-y += tcg.o diff --git a/stubs/tcg.c b/stubs/tcg.c new file mode 100644 index 0000000..15a11d6 --- /dev/null +++ b/stubs/tcg.c @@ -0,0 +1,5 @@ +#include "qemu-common.h" + +void tcg_arch_init(void) +{ +} diff --git a/translate-all.c b/translate-all.c index c24cfe8..8e15a78 100644 --- a/translate-all.c +++ b/translate-all.c @@ -702,6 +702,7 @@ void tcg_exec_init(unsigned long tb_size) initialize the prologue now. */ tcg_prologue_init(&tcg_ctx); #endif + tcg_arch_init(); } bool tcg_enabled(void) -- 1.9.3