提交 8b881e77 编写于 作者: A Avi Kivity

pci: simplify memory region registration

The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are
identical.  Unify them.
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 adfc39ea
...@@ -998,17 +998,8 @@ static void pci_update_mappings(PCIDevice *d) ...@@ -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);
}
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册