aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-08 16:09:30 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-08 10:22:30 -0500
commit50181f10dae755aad2b4f4f486d18e48dd66ea37 (patch)
tree1edd7d418482ceec78b14167fd1934dfd161c3b7 /hw/pci.c
parentcfc0be257ca75abf357757661d4950aeeb4a8835 (diff)
downloadqemu-50181f10dae755aad2b4f4f486d18e48dd66ea37.zip
qemu-50181f10dae755aad2b4f4f486d18e48dd66ea37.tar.gz
qemu-50181f10dae755aad2b4f4f486d18e48dd66ea37.tar.bz2
pci: fold BAR mapping function into its caller
There is only one function, so no need for a function pointer. Reviewed-by: Richard Henderson <rth@twiddle.net> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 62b34d4..aa17395 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -881,18 +881,6 @@ static int pci_unregister_device(DeviceState *dev)
return 0;
}
-static void pci_simple_bar_mapfunc_region(PCIDevice *pci_dev, int region_num,
- pcibus_t addr, pcibus_t size,
- int type)
-{
- PCIIORegion *r = &pci_dev->io_regions[region_num];
-
- memory_region_add_subregion_overlap(r->address_space,
- addr,
- r->memory,
- 1);
-}
-
void pci_register_bar_region(PCIDevice *pci_dev, int region_num,
uint8_t type, MemoryRegion *memory)
{
@@ -914,7 +902,6 @@ void pci_register_bar_region(PCIDevice *pci_dev, int region_num,
r->size = size;
r->filtered_size = size;
r->type = type;
- r->map_func = pci_simple_bar_mapfunc_region;
r->memory = NULL;
wmask = ~(size - 1);
@@ -1102,10 +1089,16 @@ static void pci_update_mappings(PCIDevice *d)
* addr & (size - 1) != 0.
*/
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
- r->map_func(d, i, r->addr, r->filtered_size, r->type);
+ memory_region_add_subregion_overlap(r->address_space,
+ r->addr,
+ r->memory,
+ 1);
} else {
- r->map_func(d, i, pci_to_cpu_addr(d->bus, r->addr),
- r->filtered_size, r->type);
+ memory_region_add_subregion_overlap(r->address_space,
+ pci_to_cpu_addr(d->bus,
+ r->addr),
+ r->memory,
+ 1);
}
}
}