From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqyh1-0002Vo-Nb for qemu-devel@nongnu.org; Fri, 15 Apr 2016 04:01:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqyh0-0001f7-Lp for qemu-devel@nongnu.org; Fri, 15 Apr 2016 04:01:31 -0400 Date: Fri, 15 Apr 2016 15:13:22 +1000 From: David Gibson Message-ID: <20160415051322.GL18218@voom.redhat.com> References: <1460042594-8056-1-git-send-email-mark.cave-ayland@ilande.co.uk> <1460042594-8056-2-git-send-email-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VBq/nvTu32OVLBUP" Content-Disposition: inline In-Reply-To: <1460042594-8056-2-git-send-email-mark.cave-ayland@ilande.co.uk> Subject: Re: [Qemu-devel] [RFC 1/4] target-ppc: introduce PPCMachineClass and PPCMachineState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: aik@ozlabs.ru, agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org --VBq/nvTu32OVLBUP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 07, 2016 at 04:23:11PM +0100, Mark Cave-Ayland wrote: > Introduce PPCMachineClass in anticipation of making it the superclass for > all PPC machines. >=20 > Signed-off-by: Mark Cave-Ayland > --- > hw/ppc/ppc.c | 16 ++++++++++++++++ > include/hw/ppc/ppc.h | 16 ++++++++++++++++ > include/qemu/typedefs.h | 2 ++ > 3 files changed, 34 insertions(+) >=20 > diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c > index 38ff2e1..ccdca5d 100644 > --- a/hw/ppc/ppc.c > +++ b/hw/ppc/ppc.c > @@ -1343,3 +1343,19 @@ PowerPCCPU *ppc_get_vcpu_by_dt_id(int cpu_dt_id) > =20 > return NULL; > } > + > +/* Generic PPC machine */ > +static const TypeInfo ppc_machine_info =3D { > + .name =3D TYPE_PPC_MACHINE, > + .parent =3D TYPE_MACHINE, > + .abstract =3D true, > + .instance_size =3D sizeof(PPCMachineState), > + .class_size =3D sizeof(PPCMachineClass) > +}; > + > +static void ppc_machine_register_types(void) > +{ > + type_register_static(&ppc_machine_info); > +} > + > +type_init(ppc_machine_register_types) > diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h > index 14efd0c..f1be147 100644 > --- a/include/hw/ppc/ppc.h > +++ b/include/hw/ppc/ppc.h > @@ -1,6 +1,22 @@ > #ifndef HW_PPC_H > #define HW_PPC_H 1 > =20 > +#include "hw/boards.h" > + > +struct PPCMachineState { > + /*< private >*/ > + MachineState parent_obj; > +}; > + > +struct PPCMachineClass { > + /*< private >*/ > + MachineClass parent_class; > +}; It's normal QOM practice not to create actual typedefs if there's nothing in them except the parent object. I believe you're adding something to one of these in subsequent patches, in which case it's ok to create it here, but I don't think that's true for both of them. > +#define TYPE_PPC_MACHINE "generic-ppc-machine" > +#define PPC_MACHINE(obj) \ > + OBJECT_CHECK(PPCMachineState, (obj), TYPE_PPC_MACHINE) > + > void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level); > =20 > /* PowerPC hardware exceptions management helpers */ > diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h > index 1dcf6f5..73fbad5 100644 > --- a/include/qemu/typedefs.h > +++ b/include/qemu/typedefs.h > @@ -73,6 +73,8 @@ typedef struct PCMachineState PCMachineState; > typedef struct PCMCIACardState PCMCIACardState; > typedef struct PixelFormat PixelFormat; > typedef struct PostcopyDiscardState PostcopyDiscardState; > +typedef struct PPCMachineClass PPCMachineClass; > +typedef struct PPCMachineState PPCMachineState; > typedef struct Property Property; > typedef struct PropertyInfo PropertyInfo; > typedef struct QEMUBH QEMUBH; --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --VBq/nvTu32OVLBUP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXEHhyAAoJEGw4ysog2bOSQZ0QAJJKBRZJXi/Pj2H4J1h4nn5M nycgcg8ytMOY9tjIO4q5LAT/dkpN+rvqAca7ATXtCZW3M6sjKpQv9iXiCSE6ua2z 2NSzLF5xGtbLuV8zlTU43gdnwbhS5zuDD1zXTTKG5pEUN7l7CvAonRbquWqF71ik 1Uz8oeRgWiWVrmqfHmR8Ri0B2ZuQUBQex3BUE2OSerW+QM0JYMQ6nNSwHZKv3kvM xjrr8oNlO6Az84caXrqIwbFsGD8F5ZRxjobQ7e1YE5P9Mqd3GIBAwEq8f39dsFM5 3+dqZ5hRHEAlMVx+gnwh6YbzXTBeB5uY0+4IOlCqBP19pqOPjfyP01JkjI7wxpnS ckwdLo7iwev3qAX//0of9WHKfQ0lf7Z+vtvuuNddybVXToA7ySzKWDhlw6glSOEw MOgvboZ912bvHOK6huH05nFG9C2hMtQAHvI1AtV91DcNbvzJOUTI9yl+JIDFgEgg K3RZl5cGr6AgTqEXthysuLrrM0Bo4uGZOUsjPqKiI9FGCLUz6JNb99NgMXfb3msp eSH0PSMJ23Qjm+w+B3HQnq1lU9/BKtuzHUeK/otAe6elmg/gXGU4Ya5JCCBKpoqp D6WJi3HG47ErpryU/RKGE9kSG1qCMFP+r+oST9TPCsGHVwHGAWknsk6214UBZSDi t8DBjWtR2oOZJ+SWXSE1 =eRIF -----END PGP SIGNATURE----- --VBq/nvTu32OVLBUP--