mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00: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:
13
hw/pci.c
13
hw/pci.c
@@ -998,17 +998,8 @@ static void pci_update_mappings(PCIDevice *d)
|
||||
}
|
||||
r->addr = new_addr;
|
||||
if (r->addr != PCI_BAR_UNMAPPED) {
|
||||
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
|
||||
memory_region_add_subregion_overlap(r->address_space,
|
||||
r->addr,
|
||||
r->memory,
|
||||
1);
|
||||
} else {
|
||||
memory_region_add_subregion_overlap(r->address_space,
|
||||
r->addr,
|
||||
r->memory,
|
||||
1);
|
||||
}
|
||||
memory_region_add_subregion_overlap(r->address_space,
|
||||
r->addr, r->memory, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user