aboutsummaryrefslogtreecommitdiff
path: root/hw/vga-isa.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-08 16:08:57 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-08 10:15:52 -0500
commitb195043003d90ea4027ea01cc7a6c974ac915108 (patch)
tree580d346354f3b4cb4cd1381c0e8843b272c191be /hw/vga-isa.c
parent7b619b9ae5c55eb443da19183f98f62138bd012a (diff)
downloadqemu-b195043003d90ea4027ea01cc7a6c974ac915108.zip
qemu-b195043003d90ea4027ea01cc7a6c974ac915108.tar.gz
qemu-b195043003d90ea4027ea01cc7a6c974ac915108.tar.bz2
vga: convert vga and its derivatives to the memory API
Convert all vga memory to the memory API. Note we need to fall back to get_system_memory(), since the various buses don't pass the vga window as a memory region. We no longer need to sync the dirty bitmap of the cirrus mapped memory banks, since the memory API takes care of that for us. [jan: fix vga-pci logging] Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/vga-isa.c')
-rw-r--r--hw/vga-isa.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/vga-isa.c b/hw/vga-isa.c
index 245841f..fef7f58 100644
--- a/hw/vga-isa.c
+++ b/hw/vga-isa.c
@@ -28,6 +28,7 @@
#include "pixel_ops.h"
#include "qemu-timer.h"
#include "loader.h"
+#include "exec-memory.h"
typedef struct ISAVGAState {
ISADevice dev;
@@ -46,13 +47,14 @@ static int vga_initfn(ISADevice *dev)
{
ISAVGAState *d = DO_UPCAST(ISAVGAState, dev, dev);
VGACommonState *s = &d->state;
- int vga_io_memory;
+ MemoryRegion *vga_io_memory;
vga_common_init(s, VGA_RAM_SIZE);
vga_io_memory = vga_init_io(s);
- cpu_register_physical_memory(isa_mem_base + 0x000a0000, 0x20000,
- vga_io_memory);
- qemu_register_coalesced_mmio(isa_mem_base + 0x000a0000, 0x20000);
+ memory_region_add_subregion_overlap(get_system_memory(),
+ isa_mem_base + 0x000a0000,
+ vga_io_memory, 1);
+ memory_region_set_coalescing(vga_io_memory);
isa_init_ioport(dev, 0x3c0);
isa_init_ioport(dev, 0x3b4);
isa_init_ioport(dev, 0x3ba);