@@ -176,12 +176,15 @@
#define PCI_ADDR(busno,devno,funno,regno) \
((((busno)<<16)&0xff0000) + (((devno)<<11)&0xf800) + (((funno)<<8)&0x700) + (regno))
-typedef PCIHostState BonitoState;
+typedef struct {
+ SysBusDevice busdev;
+ PCIHostState pci;
+} BonitoState;
typedef struct PCIBonitoState
{
PCIDevice dev;
- BonitoState *pcihost;
+ PCIHostState *pcihost;
uint32_t regs[BONITO_REGS];
struct bonldma {
@@ -773,13 +776,13 @@ PCIBus *bonito_init(qemu_irq *pic)
pcihost = FROM_SYSBUS(BonitoState, sysbus_from_qdev(dev));
b = pci_register_bus(&pcihost->busdev.qdev, "pci", pci_bonito_set_irq,
pci_bonito_map_irq, pic, 0x28, 32);
- pcihost->bus = b;
+ pcihost->pci.bus = b;
qdev_init_nofail(dev);
- pci_bus_set_mem_base(pcihost->bus, 0x10000000);
+ pci_bus_set_mem_base(pcihost->pci.bus, 0x10000000);
d = pci_create_simple(b, PCI_DEVFN(0, 0), "Bonito");
s = DO_UPCAST(PCIBonitoState, dev, d);
- s->pcihost = pcihost;
+ s->pcihost = &pcihost->pci;
bonito_state = s;
return b;
@@ -32,7 +32,6 @@
#include "rwhandler.h"
struct PCIHostState {
- SysBusDevice busdev;
ReadWriteHandler conf_noswap_handler;
ReadWriteHandler conf_handler;
ReadWriteHandler data_noswap_handler;
@@ -34,7 +34,10 @@
* http://download.intel.com/design/chipsets/datashts/29054901.pdf
*/
-typedef PCIHostState I440FXState;
+typedef struct {
+ SysBusDevice busdev;
+ PCIHostState pci;
+} I440FXState;
typedef struct PIIX3State {
PCIDevice dev;
@@ -194,9 +197,9 @@ static int i440fx_pcihost_initfn(SysBusDevice *dev)
{
I440FXState *s = FROM_SYSBUS(I440FXState, dev);
- pci_host_conf_register_ioport(0xcf8, s);
+ pci_host_conf_register_ioport(0xcf8, &s->pci);
- pci_host_data_register_ioport(0xcfc, s);
+ pci_host_data_register_ioport(0xcfc, &s->pci);
return 0;
}
@@ -226,7 +229,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *
dev = qdev_create(NULL, "i440FX-pcihost");
s = FROM_SYSBUS(I440FXState, sysbus_from_qdev(dev));
b = pci_bus_new(&s->busdev.qdev, NULL, 0);
- s->bus = b;
+ s->pci.bus = b;
qdev_init_nofail(dev);
d = pci_create_simple(b, 0, "i440FX");
It is mostly unused expcet i440fx and bonito. So remove the member. Cc: Huacai Chen <zltjiangshi@gmail.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> --- hw/bonito.c | 13 ++++++++----- hw/pci_host.h | 1 - hw/piix_pci.c | 11 +++++++---- 3 files changed, 15 insertions(+), 10 deletions(-)