diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-17 11:20:01 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-17 11:20:01 +0100 |
commit | 470831aeb214c23d380b20fb1b81c42a4559b94d (patch) | |
tree | 0575d81064bf96edc1be2b5f77bf5cb9859e3d58 /tools/ioemu | |
parent | 518ec3d34355be1f907a7e8ef4ca5195413edb70 (diff) | |
download | xen-470831aeb214c23d380b20fb1b81c42a4559b94d.tar.gz xen-470831aeb214c23d380b20fb1b81c42a4559b94d.tar.bz2 xen-470831aeb214c23d380b20fb1b81c42a4559b94d.zip |
ioemu: fix the devices loop.
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Diffstat (limited to 'tools/ioemu')
-rw-r--r-- | tools/ioemu/hw/pci.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/ioemu/hw/pci.c b/tools/ioemu/hw/pci.c index 4f55d1da07..b68dd3f91a 100644 --- a/tools/ioemu/hw/pci.c +++ b/tools/ioemu/hw/pci.c @@ -644,17 +644,21 @@ PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id, int pt_chk_bar_overlap(PCIBus *bus, int devfn, uint32_t addr, uint32_t size) { - PCIDevice *devices = (PCIDevice *)bus->devices; + PCIDevice *devices = NULL; PCIIORegion *r; int ret = 0; int i, j; /* check Overlapped to Base Address */ - for (i=0; i<256; i++, devices++) + for (i=0; i<256; i++) { - if ((devices == NULL) || (devices->devfn == devfn)) + if ( !(devices = bus->devices[i]) ) continue; + /* skip itself */ + if (devices->devfn == devfn) + continue; + for (j=0; j<PCI_NUM_REGIONS; j++) { r = &devices->io_regions[j]; |