qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] integratorcp: convert control to sysbus


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] integratorcp: convert control to sysbus
Date: Wed, 19 Oct 2011 13:42:14 +0100

2011/10/19 Benoît Canet <address@hidden>:
> +static int icp_control_init(SysBusDevice *dev)
>  {
> -    MemoryRegion *io;
> +    icp_control_state *s = FROM_SYSBUS(icp_control_state, dev);
>
> -    io = (MemoryRegion *)g_malloc0(sizeof(MemoryRegion));
> -    memory_region_init_io(io, &icp_control_ops, NULL,
> +    memory_region_init_io(&s->iomem, &icp_control_ops, s,
>                           "control", 0x00800000);
> -    memory_region_add_subregion(get_system_memory(), base, io);
> +    sysbus_init_mmio_region(dev, &s->iomem);
>     /* ??? Save/restore.  */
> +    return 0;
>  }

You should delete the "??? Save/restore" comment -- the
device currently has no state it needs to save/restore, and
now it's a sysbus device we have an easy path to add save/restore
if we do add state (ie we can at that point give it a vmstate).

Otherwise looks good.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]