From: Glauber Costa <[EMAIL PROTECTED]> map which io registers where already sucessfuly registered
Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- qemu/hw/pci.c | 5 +++-- qemu/hw/pci.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index 1937408..7e4ce2d 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -199,7 +199,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev) for(i = 0; i < PCI_NUM_REGIONS; i++) { r = &pci_dev->io_regions[i]; - if (!r->size) + if ((!r->size) || (r->status != PCI_STATUS_REGISTERED)) continue; if (r->type == PCI_ADDRESS_SPACE_IO) { isa_unassign_ioport(r->addr, r->size); @@ -321,7 +321,7 @@ static void pci_update_mappings(PCIDevice *d) } else { isa_unassign_ioport(r->addr, r->size); } - } else { + } else if (r->status == PCI_STATUS_REGISTERED) { cpu_register_physical_memory(pci_to_cpu_addr(r->addr), r->size, IO_MEM_UNASSIGNED); @@ -330,6 +330,7 @@ static void pci_update_mappings(PCIDevice *d) r->addr = new_addr; if (r->addr != -1) { r->map_func(d, i, r->addr, r->size, r->type); + r->status = PCI_STATUS_REGISTERED; } } } diff --git a/qemu/hw/pci.h b/qemu/hw/pci.h index e11fbbf..6350ad2 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -27,9 +27,12 @@ typedef struct PCIIORegion { uint32_t addr; /* current PCI mapping address. -1 means not mapped */ uint32_t size; uint8_t type; + uint8_t status; PCIMapIORegionFunc *map_func; } PCIIORegion; +#define PCI_STATUS_REGISTERED 1 + #define PCI_ROM_SLOT 6 #define PCI_NUM_REGIONS 7 -- 1.5.5 ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel