From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1p8y-0001Tb-Lx for qemu-devel@nongnu.org; Thu, 18 Dec 2014 23:26:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1p8s-0002Nj-GF for qemu-devel@nongnu.org; Thu, 18 Dec 2014 23:26:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1p8s-0002N7-7p for qemu-devel@nongnu.org; Thu, 18 Dec 2014 23:26:18 -0500 From: Eduardo Habkost Date: Fri, 19 Dec 2014 02:26:04 -0200 Message-Id: <1418963165-498-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1418963165-498-1-git-send-email-ehabkost@redhat.com> References: <1418963165-498-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] tcg: Introduce tcg_arch_init() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , rth@twiddle.net 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 --- 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