From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvLcs-0003VC-CW for qemu-devel@nongnu.org; Wed, 16 Jan 2013 00:33:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvLcq-00081h-1q for qemu-devel@nongnu.org; Wed, 16 Jan 2013 00:33:26 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59594 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvLcp-00081H-PU for qemu-devel@nongnu.org; Wed, 16 Jan 2013 00:33:23 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 16 Jan 2013 06:32:54 +0100 Message-Id: <1358314380-9400-10-git-send-email-afaerber@suse.de> In-Reply-To: <1358314380-9400-1-git-send-email-afaerber@suse.de> References: <1358314380-9400-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC qom-cpu 09/15] target-microblaze: Introduce QOM realizefn for MicroBlazeCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , =?UTF-8?q?Andreas=20F=C3=A4rber?= Introduce realizefn and set realized =3D true from cpu_mb_init(). Signed-off-by: Andreas F=C3=A4rber --- target-microblaze/cpu.c | 11 +++++++++++ target-microblaze/translate.c | 3 +-- 2 Dateien ge=C3=A4ndert, 12 Zeilen hinzugef=C3=BCgt(+), 2 Zeilen entfern= t(-) diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c index 0f858fd..b59180d 100644 --- a/target-microblaze/cpu.c +++ b/target-microblaze/cpu.c @@ -84,6 +84,14 @@ static void mb_cpu_reset(CPUState *s) #endif } =20 +static void mb_cpu_realizefn(DeviceState *dev, Error **errp) +{ + MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(dev); + + cpu_reset(CPU(cpu)); + qemu_init_vcpu(&cpu->env); +} + static void mb_cpu_initfn(Object *obj) { MicroBlazeCPU *cpu =3D MICROBLAZE_CPU(obj); @@ -96,9 +104,12 @@ static void mb_cpu_initfn(Object *obj) =20 static void mb_cpu_class_init(ObjectClass *oc, void *data) { + DeviceClass *dc =3D DEVICE_CLASS(oc); CPUClass *cc =3D CPU_CLASS(oc); MicroBlazeCPUClass *mcc =3D MICROBLAZE_CPU_CLASS(oc); =20 + dc->realize =3D mb_cpu_realizefn; + mcc->parent_reset =3D cc->reset; cc->reset =3D mb_cpu_reset; } diff --git a/target-microblaze/translate.c b/target-microblaze/translate.= c index 58ce712..a84856b 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -1970,8 +1970,7 @@ MicroBlazeCPU *cpu_mb_init(const char *cpu_model) =20 cpu =3D MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); =20 - cpu_reset(CPU(cpu)); - qemu_init_vcpu(&cpu->env); + object_property_set_bool(OBJECT(cpu), true, "realized", NULL); =20 if (tcg_initialized) { return cpu; --=20 1.7.10.4