qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register


From: Benoît Canet
Subject: Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API
Date: Wed, 23 Nov 2011 18:55:59 +0100



2011/11/23 Peter Maydell <address@hidden>
2011/11/22 Benoît Canet <address@hidden>:
>  static int bonito_initfn(PCIDevice *dev)
>  {
>     PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
> +    SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev);

This looks odd. The device here is a PCIBonitoState, which
is-a PCIDevice, which is-a DeviceState. It's not a SysBusDevice
and merely casting doesn't make it one.

I'm not sure what should be being done here, but I'm pretty
sure this won't work...

It would work using memory_region_add_subregion() and get_system_memory() but
Avi previously noticed me that using get_system_memory() in devices is wrong
because it goes against one of the goals of the memory API : avoiding global knowledge.
I think I need Avi's advices on this one.

reply via email to

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