mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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
1 changed files with 2 additions and 11 deletions
13
hw/pci.c
13
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->memory, 1);
|
||||||
r->addr,
|
|
||||||
r->memory,
|
|
||||||
1);
|
|
||||||
} else {
|
|
||||||
memory_region_add_subregion_overlap(r->address_space,
|
|
||||||
r->addr,
|
|
||||||
r->memory,
|
|
||||||
1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue