mirror of https://gitee.com/openkylin/qemu.git
pci: simplify memory region registration
The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are identical. Unify them. Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
adfc39eaef
commit
8b881e776a
11
hw/pci.c
11
hw/pci.c
|
@ -998,17 +998,8 @@ static void pci_update_mappings(PCIDevice *d)
|
||||||
}
|
}
|
||||||
r->addr = new_addr;
|
r->addr = new_addr;
|
||||||
if (r->addr != PCI_BAR_UNMAPPED) {
|
if (r->addr != PCI_BAR_UNMAPPED) {
|
||||||
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
|
|
||||||
memory_region_add_subregion_overlap(r->address_space,
|
memory_region_add_subregion_overlap(r->address_space,
|
||||||
r->addr,
|
r->addr, r->memory, 1);
|
||||||
r->memory,
|
|
||||||
1);
|
|
||||||
} else {
|
|
||||||
memory_region_add_subregion_overlap(r->address_space,
|
|
||||||
r->addr,
|
|
||||||
r->memory,
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue