From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42696 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc3x3-00030V-Au for qemu-devel@nongnu.org; Thu, 22 Jul 2010 18:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oc3nv-0002yK-0U for qemu-devel@nongnu.org; Thu, 22 Jul 2010 17:59:47 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:35073) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oc3nu-0002yG-TL for qemu-devel@nongnu.org; Thu, 22 Jul 2010 17:59:46 -0400 Received: by qwf6 with SMTP id 6so3333686qwf.4 for ; Thu, 22 Jul 2010 14:59:46 -0700 (PDT) MIME-Version: 1.0 From: Blue Swirl Date: Thu, 22 Jul 2010 21:59:26 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH 18/34] cirrus_vga: convert to pci_bar_map List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Use pci_bar_map() and post_map_func instead of a mapping function. Signed-off-by: Blue Swirl --- 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