diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-02-13 14:01:05 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-02-20 09:34:31 +0000 |
commit | 7435b791ca9c76b11a9dba4beb60656f951432c1 (patch) | |
tree | bf3186d1b68a69c9fa3bd3e4ee19c25d6b81a3d7 /hw/vga.c | |
parent | 1c9c5fcdfef9d97e5f6d4ce37d41a205a26f0347 (diff) | |
download | qemu-7435b791ca9c76b11a9dba4beb60656f951432c1.zip qemu-7435b791ca9c76b11a9dba4beb60656f951432c1.tar.gz qemu-7435b791ca9c76b11a9dba4beb60656f951432c1.tar.bz2 |
vga-isa: convert to qdev
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/vga.c')
-rw-r--r-- | hw/vga.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -2260,12 +2260,8 @@ void vga_common_init(VGACommonState *s, int vga_ram_size) } /* used by both ISA and PCI */ -void vga_init(VGACommonState *s) +int vga_init_io(VGACommonState *s) { - int vga_io_memory; - - qemu_register_reset(vga_reset, s); - register_ioport_write(0x3c0, 16, 1, vga_ioport_write, s); register_ioport_write(0x3b4, 2, 1, vga_ioport_write, s); @@ -2279,7 +2275,6 @@ void vga_init(VGACommonState *s) register_ioport_read(0x3d4, 2, 1, vga_ioport_read, s); register_ioport_read(0x3ba, 1, 1, vga_ioport_read, s); register_ioport_read(0x3da, 1, 1, vga_ioport_read, s); - s->bank_offset = 0; #ifdef CONFIG_BOCHS_VBE #if defined (TARGET_I386) @@ -2297,8 +2292,19 @@ void vga_init(VGACommonState *s) #endif #endif /* CONFIG_BOCHS_VBE */ - vga_io_memory = cpu_register_io_memory(vga_mem_read, vga_mem_write, s, - DEVICE_LITTLE_ENDIAN); + return cpu_register_io_memory(vga_mem_read, vga_mem_write, s, + DEVICE_LITTLE_ENDIAN); +} + +void vga_init(VGACommonState *s) +{ + int vga_io_memory; + + qemu_register_reset(vga_reset, s); + + s->bank_offset = 0; + + 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); |