* [Qemu-devel] [PATCH 22/34] vga-pci: convert to pci_bar_map
@ 2010-07-22 22:00 Blue Swirl
0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2010-07-22 22:00 UTC (permalink / raw)
To: qemu-devel
Use pci_bar_map() and post_map_func instead of a mapping function.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/vga-pci.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/hw/vga-pci.c b/hw/vga-pci.c
index 216071f..c627a79 100644
--- a/hw/vga-pci.c
+++ b/hw/vga-pci.c
@@ -52,14 +52,12 @@ static void vga_map(PCIDevice *pci_dev, int region_num,
{
PCIVGAState *d = (PCIVGAState *)pci_dev;
VGACommonState *s = &d->vga;
- if (region_num == PCI_ROM_SLOT) {
- cpu_register_physical_memory(addr, s->bios_size, s->bios_offset);
- } else {
- cpu_register_physical_memory(addr, s->vram_size, s->vram_offset);
- s->map_addr = addr;
- s->map_end = addr + s->vram_size;
- vga_dirty_log_start(s);
- }
+
+ assert(region_num != PCI_ROM_SLOT);
+
+ s->map_addr = addr;
+ s->map_end = addr + s->vram_size;
+ vga_dirty_log_start(s);
}
static void pci_vga_write_config(PCIDevice *d,
@@ -92,8 +90,9 @@ static int pci_vga_initfn(PCIDevice *dev)
pci_config_set_class(pci_conf, PCI_CLASS_DISPLAY_VGA);
/* XXX: VGA_RAM_SIZE must be a power of two */
- pci_register_bar(&d->dev, 0, VGA_RAM_SIZE,
- PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map, NULL);
+ pci_register_bar(&d->dev, 0, VGA_RAM_SIZE, PCI_BASE_ADDRESS_MEM_PREFETCH,
+ NULL, vga_map);
+ pci_bar_map(&d->dev, 0, 0, 0, s->vram_size, s->vram_offset);
if (s->bios_size) {
unsigned int bios_total_size;
@@ -102,7 +101,8 @@ static int pci_vga_initfn(PCIDevice *dev)
while (bios_total_size < s->bios_size)
bios_total_size <<= 1;
pci_register_bar(&d->dev, PCI_ROM_SLOT, bios_total_size,
- PCI_BASE_ADDRESS_MEM_PREFETCH, vga_map, NULL);
+ PCI_BASE_ADDRESS_MEM_PREFETCH, NULL, NULL);
+ pci_bar_map(&d->dev, PCI_ROM_SLOT, 0, 0, s->bios_size, s->bios_offset);
}
vga_init_vbe(s);
--
1.6.2.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-22 22:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 22:00 [Qemu-devel] [PATCH 22/34] vga-pci: convert to pci_bar_map Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).