qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	rth@twiddle.net
Subject: [Qemu-devel] [PATCH 1/2] tcg: Introduce tcg_arch_init() function
Date: Fri, 19 Dec 2014 02:26:04 -0200	[thread overview]
Message-ID: <1418963165-498-2-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1418963165-498-1-git-send-email-ehabkost@redhat.com>

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

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

  reply	other threads:[~2014-12-19  4:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-19  4:26 [Qemu-devel] [PATCH 0/2] tcg: Move TCG arch-specific initialization inside TCG code Eduardo Habkost
2014-12-19  4:26 ` Eduardo Habkost [this message]
2014-12-19 14:05   ` [Qemu-devel] [PATCH 1/2] tcg: Introduce tcg_arch_init() function Richard Henderson
2014-12-19  4:26 ` [Qemu-devel] [PATCH 2/2] target-i386: Implement tcg_arch_init() Eduardo Habkost
2014-12-19  9:47 ` [Qemu-devel] [PATCH 0/2] tcg: Move TCG arch-specific initialization inside TCG code Andreas Färber
2014-12-19 10:29   ` Paolo Bonzini
2014-12-19 13:16     ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1418963165-498-2-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=afaerber@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).