From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrtiH-0001fA-Pu for qemu-devel@nongnu.org; Mon, 30 Jan 2012 11:04:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrtiA-0001Ui-IF for qemu-devel@nongnu.org; Mon, 30 Jan 2012 11:04:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39905 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrtiA-0001UX-DZ for qemu-devel@nongnu.org; Mon, 30 Jan 2012 11:04:06 -0500 Message-ID: <4F26BEED.6090707@suse.de> Date: Mon, 30 Jan 2012 17:01:49 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1327843531-32403-1-git-send-email-afaerber@suse.de> <1327843531-32403-8-git-send-email-afaerber@suse.de> <4F25FEEE.5040504@codemonkey.ws> In-Reply-To: <4F25FEEE.5040504@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC 7/7] target-arm: Embed CPUARMState in QOM ARMCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Am 30.01.2012 03:22, schrieb Anthony Liguori: > On 01/29/2012 07:25 AM, Andreas F=C3=A4rber wrote: >> +static void arm_cpu_realize(Object *obj) >> +{ >> + ARMCPU *cpu =3D ARM_CPU(obj); >> + ARMCPUClass *cpu_class =3D ARM_CPU_GET_CLASS(obj); >> + >> + memset(&cpu->env, 0, sizeof(CPUARMState)); >> + cpu_exec_init(&cpu->env); >> + >> + cpu->env.cpu_model_str =3D object_get_typename(obj); >> + cpu->env.cp15.c0_cpuid =3D cpu_class->id; >> +} >> + >> static void cpu_register(const struct ARMCPUDef *def) >> { >> TypeInfo type =3D { >> .name =3D def->name, >> .parent =3D TYPE_ARM_CPU, >> .instance_size =3D sizeof(ARMCPU), >> + .instance_init =3D arm_cpu_realize, >=20 >=20 > The convention I'm using is: instance_init =3D> type_name_initfn. >=20 > DeviceState::init =3D> type_name_realize, Fixed, thanks. Andreas >=20 > Eventually, realized will become a property and there will be a realize > and unrealize method. --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg