From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 18/34] cirrus_vga: convert to pci_bar_map
Date: Thu, 22 Jul 2010 21:59:26 +0000 [thread overview]
Message-ID: <AANLkTilsBN4Z4zHII5HJs_N4GMUFlZ_WngOXsEiLOcLk@mail.gmail.com> (raw)
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
reply other threads:[~2010-07-22 22:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTilsBN4Z4zHII5HJs_N4GMUFlZ_WngOXsEiLOcLk@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).