qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 18/34] cirrus_vga: convert to pci_bar_map
@ 2010-07-22 21:59 Blue Swirl
  0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2010-07-22 21:59 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/cirrus_vga.c |   26 ++++++++------------------
 1 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 7c14361..a9ccb69 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -3144,12 +3144,6 @@ static void cirrus_pci_lfb_map(PCIDevice *d,
int region_num,
 {
     CirrusVGAState *s = &DO_UPCAST(PCICirrusVGAState, dev, d)->cirrus_vga;

-    /* XXX: add byte swapping apertures */
-    cpu_register_physical_memory(addr, s->vga.vram_size,
-				 s->cirrus_linear_io_addr);
-    cpu_register_physical_memory(addr + 0x1000000, 0x400000,
-				 s->cirrus_linear_bitblt_io_addr);
-
     s->vga.map_addr = s->vga.map_end = 0;
     s->vga.lfb_addr = addr & TARGET_PAGE_MASK;
     s->vga.lfb_end = ((addr + VGA_RAM_SIZE) + TARGET_PAGE_SIZE - 1) &
TARGET_PAGE_MASK;
@@ -3160,15 +3154,6 @@ static void cirrus_pci_lfb_map(PCIDevice *d,
int region_num,
     vga_dirty_log_start(&s->vga);
 }

-static void cirrus_pci_mmio_map(PCIDevice *d, int region_num,
-				pcibus_t addr, pcibus_t size, int type)
-{
-    CirrusVGAState *s = &DO_UPCAST(PCICirrusVGAState, dev, d)->cirrus_vga;
-
-    cpu_register_physical_memory(addr, CIRRUS_PNPMMIO_SIZE,
-				 s->cirrus_mmio_io_addr);
-}
-
 static void pci_cirrus_write_config(PCIDevice *d,
                                     uint32_t address, uint32_t val, int len)
 {
@@ -3205,11 +3190,16 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
      /* memory #1 memory-mapped I/O */
      /* XXX: s->vga.vram_size must be a power of two */
      pci_register_bar((PCIDevice *)d, 0, 0x2000000,
-                      PCI_BASE_ADDRESS_MEM_PREFETCH, cirrus_pci_lfb_map, NULL);
+                      PCI_BASE_ADDRESS_MEM_PREFETCH, NULL, cirrus_pci_lfb_map);
+     pci_bar_map((PCIDevice *)d, 0, 0, 0, s->vga.vram_size,
+                 s->cirrus_linear_io_addr);
+     pci_bar_map((PCIDevice *)d, 0, 1, 0x1000000, 0x400000,
+                 s->cirrus_linear_bitblt_io_addr);
      if (device_id == CIRRUS_ID_CLGD5446) {
          pci_register_bar((PCIDevice *)d, 1, CIRRUS_PNPMMIO_SIZE,
-                          PCI_BASE_ADDRESS_SPACE_MEMORY, cirrus_pci_mmio_map,
-                          NULL);
+                          PCI_BASE_ADDRESS_SPACE_MEMORY, NULL, NULL);
+         pci_bar_map((PCIDevice *)d, 1, 0, 0, CIRRUS_PNPMMIO_SIZE,
+                     s->cirrus_mmio_io_addr);
      }
      return 0;
 }
-- 
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 21:59 [Qemu-devel] [PATCH 18/34] cirrus_vga: 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).