diff mbox

[1/2] tcg: Introduce tcg_arch_init() function

Message ID 1418963165-498-2-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Dec. 19, 2014, 4:26 a.m. UTC
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 <ehabkost@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

Comments

Richard Henderson Dec. 19, 2014, 2:05 p.m. UTC | #1
On 12/18/2014 10:26 PM, Eduardo Habkost wrote:
> +void tcg_arch_init(void);

I'm not keen on the name, because it's fairly ambiguous whether "arch" is
talking about the host or target.  It doesn't help that "tcg_target" is the
host.  ;-P

Assuming we do this (see hook discussion), what about "translator" instead?


r~
diff mbox

Patch

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)