On Wed, Mar 16, 2011 at 11:29 AM, Isaku Yamahata <yamah...@valinux.co.jp> wrote: > apply pci_p2pbr for apb_pci.c. > > Cc: Michael S. Tsirkin <m...@redhat.com> > Cc: Blue Swirl <blauwir...@gmail.com> > Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp> > --- > hw/apb_pci.c | 63 ++++++++++++++++++++++++--------------------------------- > 1 files changed, 27 insertions(+), 36 deletions(-) > > diff --git a/hw/apb_pci.c b/hw/apb_pci.c > index c56ea9a..c9f2a6b 100644 > --- a/hw/apb_pci.c > +++ b/hw/apb_pci.c > @@ -31,6 +31,7 @@ > #include "pci_host.h" > #include "pci_bridge.h" > #include "pci_internals.h" > +#include "pci_p2pbr.h" > #include "rwhandler.h" > #include "apb_pci.h" > #include "sysemu.h" > @@ -297,16 +298,6 @@ static void pci_apb_set_irq(void *opaque, int irq_num, > int level) > > static int apb_pci_bridge_initfn(PCIDevice *dev) > { > - int rc; > - > - rc = pci_bridge_initfn(dev); > - if (rc < 0) { > - return rc; > - } > - > - pci_config_set_vendor_id(dev->config, PCI_VENDOR_ID_SUN); > - pci_config_set_device_id(dev->config, PCI_DEVICE_ID_SUN_SIMBA); > - > /* > * command register: > * According to PCI bridge spec, after reset > @@ -321,10 +312,31 @@ static int apb_pci_bridge_initfn(PCIDevice *dev) > pci_set_word(dev->config + PCI_STATUS, > PCI_STATUS_FAST_BACK | PCI_STATUS_66MHZ | > PCI_STATUS_DEVSEL_MEDIUM); > - pci_set_byte(dev->config + PCI_REVISION_ID, 0x11); > return 0; > } > > +static PCIBridge *apb_pci_bridge_init(PCIBus *bus, > + uint8_t devfn, const char *bus_name) > +{ > + const PCIP2PBridgeInit init = { > + .bus = bus, > + .devfn = devfn, > + .multifunction = true, > + > + .bus_name = bus_name, > + .map_irq = pci_apb_map_irq, > + > + .initfn = apb_pci_bridge_initfn, > + }; > + const PCIP2PBridgeProp prop = { > + .vendor_id = PCI_VENDOR_ID_SUN, > + .device_id = PCI_DEVICE_ID_SUN_SIMBA, > + .revision_id = 0x11, > + };
'static' again.