From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuUzx-0000RX-K0 for qemu-devel@nongnu.org; Mon, 06 Feb 2012 15:17:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuUzt-0003aQ-8t for qemu-devel@nongnu.org; Mon, 06 Feb 2012 15:17:13 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39016 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuUzt-0003aI-4K for qemu-devel@nongnu.org; Mon, 06 Feb 2012 15:17:09 -0500 Message-ID: <4F3034AF.3000205@suse.de> Date: Mon, 06 Feb 2012 21:14:39 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1328237992-14953-1-git-send-email-afaerber@suse.de> <1328237992-14953-4-git-send-email-afaerber@suse.de> <4F3028D2.2060409@codemonkey.ws> In-Reply-To: <4F3028D2.2060409@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Peter Maydell , qemu-devel@nongnu.org, Paolo Bonzini Am 06.02.2012 20:24, schrieb Anthony Liguori: > On 02/02/2012 08:59 PM, Andreas F=C3=A4rber wrote: >> +/** >> + * cpu_common_reset: >> + * @cpu: The CPU whose common state is to be reset. >> + * >> + * To be used by derived classes. >> + */ >> +void cpu_common_reset(CPU *cpu); >=20 > Make this static, initialize reset =3D cpu_common_reset in > cpu_class_initfn, then in the derived class initfn, save the pointer to > the parent reset function so it can be called later. I don't see how that would work. To initialize, e.g., the ARMCPUClass with additional class fields I'm overriding the .class_init. So in order to let CPUClass initialize the reset callback to its static one I'd need to make CPU's class_init function non-static so that I can call that from my derived class' class_init function, no? 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