From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDE84C19F28 for ; Wed, 3 Aug 2022 17:04:38 +0000 (UTC) Received: from localhost ([::1]:40508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJHnP-0003cd-H6 for qemu-devel@archiver.kernel.org; Wed, 03 Aug 2022 13:04:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJHmM-0002L7-5o; Wed, 03 Aug 2022 13:03:30 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]:57275) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJHmJ-0001eh-OG; Wed, 03 Aug 2022 13:03:29 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 12DC9747F1B; Wed, 3 Aug 2022 19:03:24 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id CCE7F747E0F; Wed, 3 Aug 2022 19:03:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id CB2267475F9; Wed, 3 Aug 2022 19:03:23 +0200 (CEST) Date: Wed, 3 Aug 2022 19:03:23 +0200 (CEST) From: BALATON Zoltan To: =?ISO-8859-15?Q?C=E9dric_Le_Goater?= cc: qemu-ppc@nongnu.org, Daniel Henrique Barboza , qemu-devel@nongnu.org Subject: Re: [PATCH v2 02/20] ppc/ppc405: Introduce a PPC405 generic machine In-Reply-To: <20220803132844.2370514-3-clg@kaod.org> Message-ID: References: <20220803132844.2370514-1-clg@kaod.org> <20220803132844.2370514-3-clg@kaod.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3866299591-825057409-1659546203=:36771" Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3866299591-825057409-1659546203=:36771 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Wed, 3 Aug 2022, Cédric Le Goater wrote: > We will use this machine as a base to define the ref405ep and possibly > the PPC405 hotfoot board as found in the Linux kernel. > > Signed-off-by: Cédric Le Goater > --- > hw/ppc/ppc405_boards.c | 31 ++++++++++++++++++++++++++++--- > 1 file changed, 28 insertions(+), 3 deletions(-) > > diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c > index 1a4e7588c584..4c269b6526a5 100644 > --- a/hw/ppc/ppc405_boards.c > +++ b/hw/ppc/ppc405_boards.c > @@ -50,6 +50,15 @@ > > #define USE_FLASH_BIOS > > +struct Ppc405MachineState { > + /* Private */ > + MachineState parent_obj; > + /* Public */ > +}; > + > +#define TYPE_PPC405_MACHINE MACHINE_TYPE_NAME("ppc405") > +OBJECT_DECLARE_SIMPLE_TYPE(Ppc405MachineState, PPC405_MACHINE); In other patches the declaration of the state struct comes after the OBJECT_DECLARE macro so here instead of above. It would be better to write it like that here too for consistency and also because then the DECLARE macro starts the object declaration and everything belonging to the object are together below it. Declaring the structure before is kind of outside the object, although this is only cosmetic and may be a matter of style. Regards, BALATON Zoltan > + > /*****************************************************************************/ > /* PPC405EP reference board (IBM) */ > /* Standalone board with: > @@ -332,18 +341,34 @@ static void ref405ep_class_init(ObjectClass *oc, void *data) > > mc->desc = "ref405ep"; > mc->init = ref405ep_init; > - mc->default_ram_size = 0x08000000; > - mc->default_ram_id = "ef405ep.ram"; > } > > static const TypeInfo ref405ep_type = { > .name = MACHINE_TYPE_NAME("ref405ep"), > - .parent = TYPE_MACHINE, > + .parent = TYPE_PPC405_MACHINE, > .class_init = ref405ep_class_init, > }; > > +static void ppc405_machine_class_init(ObjectClass *oc, void *data) > +{ > + MachineClass *mc = MACHINE_CLASS(oc); > + > + mc->desc = "PPC405 generic machine"; > + mc->default_ram_size = 0x08000000; > + mc->default_ram_id = "ppc405.ram"; > +} > + > +static const TypeInfo ppc405_machine_type = { > + .name = TYPE_PPC405_MACHINE, > + .parent = TYPE_MACHINE, > + .instance_size = sizeof(Ppc405MachineState), > + .class_init = ppc405_machine_class_init, > + .abstract = true, > +}; > + > static void ppc405_machine_init(void) > { > + type_register_static(&ppc405_machine_type); > type_register_static(&ref405ep_type); > } > > --3866299591-825057409-1659546203=:36771--