From: David Gibson <david@gibson.dropbear.id.au>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: aik@ozlabs.ru, agraf@suse.de, qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC 1/4] target-ppc: introduce PPCMachineClass and PPCMachineState
Date: Fri, 15 Apr 2016 15:13:22 +1000 [thread overview]
Message-ID: <20160415051322.GL18218@voom.redhat.com> (raw)
In-Reply-To: <1460042594-8056-2-git-send-email-mark.cave-ayland@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 2901 bytes --]
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.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> ---
> hw/ppc/ppc.c | 16 ++++++++++++++++
> include/hw/ppc/ppc.h | 16 ++++++++++++++++
> include/qemu/typedefs.h | 2 ++
> 3 files changed, 34 insertions(+)
>
> 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)
>
> return NULL;
> }
> +
> +/* Generic PPC machine */
> +static const TypeInfo ppc_machine_info = {
> + .name = TYPE_PPC_MACHINE,
> + .parent = TYPE_MACHINE,
> + .abstract = true,
> + .instance_size = sizeof(PPCMachineState),
> + .class_size = 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
>
> +#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);
>
> /* 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;
--
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-04-15 8:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 15:23 [Qemu-devel] [RFC 0/4] target-ppc: handle KVM timebase migration Mark Cave-Ayland
2016-04-07 15:23 ` [Qemu-devel] [RFC 1/4] target-ppc: introduce PPCMachineClass and PPCMachineState Mark Cave-Ayland
2016-04-15 5:13 ` David Gibson [this message]
2016-04-07 15:23 ` [Qemu-devel] [RFC 2/4] target-ppc: derive all PPC machine classes to have PPCMachineClass as their superclass Mark Cave-Ayland
2016-04-15 5:17 ` David Gibson
2016-04-07 15:23 ` [Qemu-devel] [RFC 3/4] target-ppc: synchronise tb_offset with KVM host on machine start Mark Cave-Ayland
2016-04-15 5:23 ` David Gibson
2016-04-07 15:23 ` [Qemu-devel] [RFC 4/4] target-ppc: hack to remove existing timebase migration code for testing Mark Cave-Ayland
2016-04-15 5:27 ` [Qemu-devel] [RFC 0/4] target-ppc: handle KVM timebase migration David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160415051322.GL18218@voom.redhat.com \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.