qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Greg Kurz <groug@kaod.org>
Subject: Re: [Qemu-devel] [PATCH v2 4/5] ppc/xics: move the vmstate structures under the ics-base class
Date: Tue, 26 Jun 2018 12:30:42 +1000	[thread overview]
Message-ID: <20180626023042.GB14434@umbus.fritz.box> (raw)
In-Reply-To: <20180625091718.18544-5-clg@kaod.org>

[-- Attachment #1: Type: text/plain, Size: 5159 bytes --]

On Mon, Jun 25, 2018 at 11:17:17AM +0200, Cédric Le Goater wrote:
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Applied, thanks.

> ---
>  hw/intc/xics.c | 112 ++++++++++++++++++++++++++++-----------------------------
>  1 file changed, 56 insertions(+), 56 deletions(-)
> 
> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> index 8cfe2231531e..b9f1a3c97214 100644
> --- a/hw/intc/xics.c
> +++ b/hw/intc/xics.c
> @@ -549,61 +549,6 @@ static void ics_simple_reset_handler(void *dev)
>      ics_simple_reset(dev);
>  }
>  
> -static int ics_simple_dispatch_pre_save(void *opaque)
> -{
> -    ICSState *ics = opaque;
> -    ICSStateClass *info = ICS_BASE_GET_CLASS(ics);
> -
> -    if (info->pre_save) {
> -        info->pre_save(ics);
> -    }
> -
> -    return 0;
> -}
> -
> -static int ics_simple_dispatch_post_load(void *opaque, int version_id)
> -{
> -    ICSState *ics = opaque;
> -    ICSStateClass *info = ICS_BASE_GET_CLASS(ics);
> -
> -    if (info->post_load) {
> -        return info->post_load(ics, version_id);
> -    }
> -
> -    return 0;
> -}
> -
> -static const VMStateDescription vmstate_ics_simple_irq = {
> -    .name = "ics/irq",
> -    .version_id = 2,
> -    .minimum_version_id = 1,
> -    .fields = (VMStateField[]) {
> -        VMSTATE_UINT32(server, ICSIRQState),
> -        VMSTATE_UINT8(priority, ICSIRQState),
> -        VMSTATE_UINT8(saved_priority, ICSIRQState),
> -        VMSTATE_UINT8(status, ICSIRQState),
> -        VMSTATE_UINT8(flags, ICSIRQState),
> -        VMSTATE_END_OF_LIST()
> -    },
> -};
> -
> -static const VMStateDescription vmstate_ics_simple = {
> -    .name = "ics",
> -    .version_id = 1,
> -    .minimum_version_id = 1,
> -    .pre_save = ics_simple_dispatch_pre_save,
> -    .post_load = ics_simple_dispatch_post_load,
> -    .fields = (VMStateField[]) {
> -        /* Sanity check */
> -        VMSTATE_UINT32_EQUAL(nr_irqs, ICSState, NULL),
> -
> -        VMSTATE_STRUCT_VARRAY_POINTER_UINT32(irqs, ICSState, nr_irqs,
> -                                             vmstate_ics_simple_irq,
> -                                             ICSIRQState),
> -        VMSTATE_END_OF_LIST()
> -    },
> -};
> -
>  static void ics_simple_realize(DeviceState *dev, Error **errp)
>  {
>      ICSState *ics = ICS_SIMPLE(dev);
> @@ -631,7 +576,6 @@ static void ics_simple_class_init(ObjectClass *klass, void *data)
>      device_class_set_parent_reset(dc, ics_simple_reset,
>                                    &isc->parent_reset);
>  
> -    dc->vmsd = &vmstate_ics_simple;
>      isc->reject = ics_simple_reject;
>      isc->resend = ics_simple_resend;
>      isc->eoi = ics_simple_eoi;
> @@ -692,6 +636,61 @@ static void ics_base_instance_init(Object *obj)
>      ics->offset = XICS_IRQ_BASE;
>  }
>  
> +static int ics_base_dispatch_pre_save(void *opaque)
> +{
> +    ICSState *ics = opaque;
> +    ICSStateClass *info = ICS_BASE_GET_CLASS(ics);
> +
> +    if (info->pre_save) {
> +        info->pre_save(ics);
> +    }
> +
> +    return 0;
> +}
> +
> +static int ics_base_dispatch_post_load(void *opaque, int version_id)
> +{
> +    ICSState *ics = opaque;
> +    ICSStateClass *info = ICS_BASE_GET_CLASS(ics);
> +
> +    if (info->post_load) {
> +        return info->post_load(ics, version_id);
> +    }
> +
> +    return 0;
> +}
> +
> +static const VMStateDescription vmstate_ics_base_irq = {
> +    .name = "ics/irq",
> +    .version_id = 2,
> +    .minimum_version_id = 1,
> +    .fields = (VMStateField[]) {
> +        VMSTATE_UINT32(server, ICSIRQState),
> +        VMSTATE_UINT8(priority, ICSIRQState),
> +        VMSTATE_UINT8(saved_priority, ICSIRQState),
> +        VMSTATE_UINT8(status, ICSIRQState),
> +        VMSTATE_UINT8(flags, ICSIRQState),
> +        VMSTATE_END_OF_LIST()
> +    },
> +};
> +
> +static const VMStateDescription vmstate_ics_base = {
> +    .name = "ics",
> +    .version_id = 1,
> +    .minimum_version_id = 1,
> +    .pre_save = ics_base_dispatch_pre_save,
> +    .post_load = ics_base_dispatch_post_load,
> +    .fields = (VMStateField[]) {
> +        /* Sanity check */
> +        VMSTATE_UINT32_EQUAL(nr_irqs, ICSState, NULL),
> +
> +        VMSTATE_STRUCT_VARRAY_POINTER_UINT32(irqs, ICSState, nr_irqs,
> +                                             vmstate_ics_base_irq,
> +                                             ICSIRQState),
> +        VMSTATE_END_OF_LIST()
> +    },
> +};
> +
>  static Property ics_base_properties[] = {
>      DEFINE_PROP_UINT32("nr-irqs", ICSState, nr_irqs, 0),
>      DEFINE_PROP_END_OF_LIST(),
> @@ -704,6 +703,7 @@ static void ics_base_class_init(ObjectClass *klass, void *data)
>      dc->realize = ics_base_realize;
>      dc->props = ics_base_properties;
>      dc->reset = ics_base_reset;
> +    dc->vmsd = &vmstate_ics_base;
>  }
>  
>  static const TypeInfo ics_base_info = {

-- 
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: 833 bytes --]

  reply	other threads:[~2018-06-26  2:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25  9:17 [Qemu-devel] [PATCH v2 0/5] rework the ICS classes inheritance tree Cédric Le Goater
2018-06-25  9:17 ` [Qemu-devel] [PATCH v2 1/5] ppc/xics: introduce a parent_realize in ICSStateClass Cédric Le Goater
2018-06-26  2:18   ` David Gibson
2018-06-25  9:17 ` [Qemu-devel] [PATCH v2 2/5] ppc/xics: move the instance_init handler under the ics-base class Cédric Le Goater
2018-06-26  2:21   ` David Gibson
2018-06-25  9:17 ` [Qemu-devel] [PATCH v2 3/5] ppx/xics: introduce a parent_reset in ICSStateClass Cédric Le Goater
2018-06-26  2:25   ` David Gibson
2018-06-25  9:17 ` [Qemu-devel] [PATCH v2 4/5] ppc/xics: move the vmstate structures under the ics-base class Cédric Le Goater
2018-06-26  2:30   ` David Gibson [this message]
2018-06-25  9:17 ` [Qemu-devel] [PATCH v2 5/5] ppc/xics: rework the ICS classes inheritance tree Cédric Le Goater
2018-06-26  3:21   ` David Gibson
2018-06-26 13:27 ` [Qemu-devel] [Qemu-ppc] [PATCH v2 0/5] " Greg Kurz
2018-06-26 16:37   ` Cédric Le Goater
2018-06-27  0:14     ` David Gibson
2018-06-27  6:34       ` Cédric Le Goater
2018-06-28  3:54         ` 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=20180626023042.GB14434@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).