[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v3 55/56] pci: fold BAR mapping function into its call
From: |
Avi Kivity |
Subject: |
[Qemu-devel] [RFC v3 55/56] pci: fold BAR mapping function into its caller |
Date: |
Sun, 10 Jul 2011 21:15:08 +0300 |
There is only one function, so no need for a function pointer.
Signed-off-by: Avi Kivity <address@hidden>
---
hw/pci.c | 25 +++++++++----------------
hw/pci.h | 1 -
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/hw/pci.c b/hw/pci.c
index 2543ced..04b6372 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->ram_addr = IO_MEM_UNASSIGNED;
r->memory = NULL;
@@ -1103,10 +1090,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);
}
}
}
diff --git a/hw/pci.h b/hw/pci.h
index 3751b13..274d719 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -92,7 +92,6 @@ typedef struct PCIIORegion {
pcibus_t size;
pcibus_t filtered_size;
uint8_t type;
- PCIMapIORegionFunc *map_func;
ram_addr_t ram_addr;
MemoryRegion *memory;
MemoryRegion *address_space;
--
1.7.5.3
- [Qemu-devel] [RFC v3 28/56] pci: pass I/O address space to new PCI bus, (continued)
- [Qemu-devel] [RFC v3 28/56] pci: pass I/O address space to new PCI bus, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 09/56] exec.c: initialize memory map, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 37/56] ivshmem: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 38/56] virtio-pci: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 20/56] vga: convert vga and its derivatives to the memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 40/56] intel-hda: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 30/56] rtl8139: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 55/56] pci: fold BAR mapping function into its caller,
Avi Kivity <=
- [Qemu-devel] [RFC v3 34/56] es1370: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 49/56] uhci: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 56/56] pci: rename pci_register_bar_region() to pci_register_bar(), Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 24/56] vga: simplify vga window mmio access functions, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 48/56] ehci: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 51/56] msix: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 54/56] pci: remove pci_register_bar(), Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 42/56] ppc: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 45/56] i6300esb: convert to memory API, Avi Kivity, 2011/07/10
- [Qemu-devel] [RFC v3 32/56] e1000: convert to memory API, Avi Kivity, 2011/07/10