From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rup7L-000431-KX for qemu-devel@nongnu.org; Tue, 07 Feb 2012 12:46:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rup7F-0007PD-Qd for qemu-devel@nongnu.org; Tue, 07 Feb 2012 12:46:11 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51459 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rup7F-0007Ov-LO for qemu-devel@nongnu.org; Tue, 07 Feb 2012 12:46:05 -0500 Message-ID: <4F3162CD.9000804@suse.de> Date: Tue, 07 Feb 2012 18:43:41 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1328237992-14953-1-git-send-email-afaerber@suse.de> <1328237992-14953-9-git-send-email-afaerber@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC v3 08/21] target-arm: Move CPU feature flags out of CPUState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org Am 07.02.2012 18:28, schrieb Peter Maydell: > On 3 February 2012 02:59, Andreas F=C3=A4rber wrote: >> +static void sa11xx_class_init(ARMCPUClass *k, const ARMCPUInfo *info) >> +{ >> + set_class_feature(k, ARM_FEATURE_STRONGARM); >> +} >=20 >> static const ARMCPUInfo arm_cpus[] =3D { >> { >> .name =3D "arm926", >> .id =3D 0x41069265, >> + .features =3D ARM_FEATURE(V5) | >> + ARM_FEATURE(VFP), >> }, >=20 >> { >> .name =3D "sa1100", >> .id =3D 0x4401A11B, >> + .class_init =3D sa11xx_class_init, >> }, >=20 > So why are we handling some of these feature bits by setting them > in .features, and some of them via a .class_init which sets the > feature bit? To avoid duplication. This corresponds to fall-throughs in the switch. Eventually as suggested by you we would get rid of some of these duplicate models and let the user (or an alias-like compatibility mechanism) set the desired revision numbers on one base class via QOM properties. Then those class_inits would no longer be needed. 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