From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrpv1-0000gX-Hh for qemu-devel@nongnu.org; Mon, 30 Jan 2012 07:01:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrpuv-0003yV-Op for qemu-devel@nongnu.org; Mon, 30 Jan 2012 07:01:07 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51388 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrpuv-0003yK-KB for qemu-devel@nongnu.org; Mon, 30 Jan 2012 07:01:01 -0500 Message-ID: <4F2685F4.2060304@suse.de> Date: Mon, 30 Jan 2012 12:58:44 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1327843531-32403-1-git-send-email-afaerber@suse.de> <1327843531-32403-5-git-send-email-afaerber@suse.de> <4F25FCF3.2000702@codemonkey.ws> In-Reply-To: <4F25FCF3.2000702@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC 4/7] qom: Introduce CPU class 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:14, schrieb Anthony Liguori: > On 01/29/2012 07:25 AM, Andreas F=C3=A4rber wrote: >> +static TypeInfo cpu_type_info =3D { >> + .name =3D TYPE_CPU, >> + .parent =3D TYPE_OBJECT, >> + .instance_size =3D sizeof(CPU), >=20 >=20 > Probably want to do CPUState or something of that nature so that you ca= n > use CPU() as a dynamic_cast macro. Yeah, I stumbled upon that but didn't need it so far. CPUState is already taken by the old concept. In an earlier version I had used CPUCore (CPU_CORE()) but then I thought that doesn't sound right for HyperThreading (CPU -> cores -> threads). Since QEMU so far uses the term "CPU" for all of those I went with that. Any better suggestions? > BTW, if the class_size =3D=3D parent.class_size you don't need to defin= e or > specific the class. I'm sorry? You mean we don't need CPUClass yet because it doesn't add anything to ObjectClass yet? I was planning on having a reset function defined there, to be called in place of current aliased cpu_reset(). For that to work I am emptying cpu_arm_reset() step by step (cf. 9/7) until it can defer to: (*CPU_GET_CLASS(ENV_GET_OBJECT(env))->reset)(ENV_GET_OBJECT(env)); I've been thinking along the lines of: if something doesn't change at runtime then it goes into a class. Or did you mean something else? Andreas --=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