qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Guan Xuetao" <gxt@mprc.pku.edu.cn>, "Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [RFC qom-cpu 14/15] target-unicore32: Introduce QOM realizefn for UniCore32CPU
Date: Wed, 16 Jan 2013 06:32:59 +0100	[thread overview]
Message-ID: <1358314380-9400-15-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1358314380-9400-1-git-send-email-afaerber@suse.de>

Introduce a realizefn and set realized = true in uc32_cpu_init().

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-unicore32/cpu.c    |   15 +++++++++++++++
 target-unicore32/helper.c |    2 +-
 2 Dateien geändert, 16 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
index 884c101..22330ad 100644
--- a/target-unicore32/cpu.c
+++ b/target-unicore32/cpu.c
@@ -61,6 +61,13 @@ static const UniCore32CPUInfo uc32_cpus[] = {
     { .name = "any",        .instance_init = uc32_any_cpu_initfn },
 };
 
+static void uc32_cpu_realizefn(DeviceState *dev, Error **errp)
+{
+    UniCore32CPU *cpu = UNICORE32_CPU(dev);
+
+    qemu_init_vcpu(&cpu->env);
+}
+
 static void uc32_cpu_initfn(Object *obj)
 {
     UniCore32CPU *cpu = UNICORE32_CPU(obj);
@@ -80,6 +87,13 @@ static void uc32_cpu_initfn(Object *obj)
     tlb_flush(env, 1);
 }
 
+static void uc32_cpu_class_init(ObjectClass *oc, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(oc);
+
+    dc->realize = uc32_cpu_realizefn;
+}
+
 static void uc32_register_cpu_type(const UniCore32CPUInfo *info)
 {
     TypeInfo type_info = {
@@ -98,6 +112,7 @@ static const TypeInfo uc32_cpu_type_info = {
     .instance_init = uc32_cpu_initfn,
     .abstract = true,
     .class_size = sizeof(UniCore32CPUClass),
+    .class_init = uc32_cpu_class_init,
 };
 
 static void uc32_cpu_register_types(void)
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index 5359538..347d842 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -42,7 +42,7 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
         uc32_translate_init();
     }
 
-    qemu_init_vcpu(env);
+    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
     return env;
 }
 
-- 
1.7.10.4

  parent reply	other threads:[~2013-01-16  5:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-16  5:32 [Qemu-devel] [RFC qom-cpu 00/15] CPUState QOM realizefn support Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 01/15] target-alpha: Update CPU to QOM realizefn Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 02/15] target-arm: " Andreas Färber
2013-01-16 15:52   ` Eduardo Habkost
2013-01-16 22:37     ` Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 03/15] target-i386: " Andreas Färber
2013-01-16 13:12   ` Igor Mammedov
2013-01-16 16:04   ` Eduardo Habkost
2013-01-16 22:52     ` Andreas Färber
2013-01-16 23:43       ` Eduardo Habkost
2013-01-17  8:03         ` Andreas Färber
2013-01-17 12:58           ` Eduardo Habkost
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 04/15] target-openrisc: " Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 05/15] target-ppc: " Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 06/15] target-cris: Introduce QOM realizefn for CRISCPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 07/15] target-lm32: Introduce QOM realizefn for LM32CPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 08/15] target-m68k: Introduce QOM realizefn for M68kCPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 09/15] target-microblaze: Introduce QOM realizefn for MicroBlazeCPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 10/15] target-mips: Introduce QOM realizefn for MIPSCPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 11/15] target-s390x: Introduce QOM realizefn for S390CPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 12/15] target-sh4: Introduce QOM realizefn for SuperHCPU Andreas Färber
2013-01-16  5:32 ` [Qemu-devel] [RFC qom-cpu 13/15] target-sparc: Introduce QOM realizefn for SPARCCPU Andreas Färber
2013-01-16  5:32 ` Andreas Färber [this message]
2013-01-16 12:08   ` [Qemu-devel] [RFC qom-cpu 14/15] target-unicore32: Introduce QOM realizefn for UniCore32CPU guanxuetao
2013-01-16  5:33 ` [Qemu-devel] [RFC qom-cpu 15/15] target-xtensa: Introduce QOM realizefn for XtensaCPU Andreas Färber

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=1358314380-9400-15-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=qemu-devel@nongnu.org \
    /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).