From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 31/34] vga: refactor vga_init
Date: Thu, 22 Jul 2010 22:03:23 +0000 [thread overview]
Message-ID: <AANLkTinwm9CSwJDvAV088GsOzjL1dKl9cMYK55vsJZlz@mail.gmail.com> (raw)
Move common stuff not related to I/O port init from vga_init() to
vga_common_init().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
hw/vga-isa-mm.c | 1 -
hw/vga.c | 5 ++---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/vga-isa-mm.c b/hw/vga-isa-mm.c
index 680b557..d4b1e95 100644
--- a/hw/vga-isa-mm.c
+++ b/hw/vga-isa-mm.c
@@ -103,7 +103,6 @@ static void vga_mm_init(ISAVGAMMState *s,
target_phys_addr_t vram_base,
vmstate_register(NULL, 0, &vmstate_vga_common, s);
cpu_register_physical_memory(ctrl_base, 0x100000, s_ioport_ctrl);
- s->vga.bank_offset = 0;
cpu_register_physical_memory(vram_base + 0x000a0000, 0x20000,
vga_io_memory);
qemu_register_coalesced_mmio(vram_base + 0x000a0000, 0x20000);
}
diff --git a/hw/vga.c b/hw/vga.c
index b5c7ee7..b612529 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2264,6 +2264,7 @@ void vga_common_init(VGACommonState *s, int vga_ram_size)
s->vram_offset = qemu_ram_alloc(NULL, "vga.vram", vga_ram_size);
s->vram_ptr = qemu_get_ram_ptr(s->vram_offset);
s->vram_size = vga_ram_size;
+ s->bank_offset = 0;
s->get_bpp = vga_get_bpp;
s->get_offsets = vga_get_offsets;
s->get_resolution = vga_get_resolution;
@@ -2282,6 +2283,7 @@ void vga_common_init(VGACommonState *s, int vga_ram_size)
s->update_retrace_info = vga_precise_update_retrace_info;
break;
}
+ qemu_register_reset(vga_reset, s);
}
/* used by both ISA and PCI */
@@ -2289,8 +2291,6 @@ void vga_init(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);
@@ -2304,7 +2304,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)
--
1.6.2.4
reply other threads:[~2010-07-22 22:08 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=AANLkTinwm9CSwJDvAV088GsOzjL1dKl9cMYK55vsJZlz@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).