aboutsummaryrefslogtreecommitdiff
path: root/hw/vga.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-01 18:59:50 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-01 18:59:50 +0000
commit8da3ff180974732fc4272cb4433fef85c1822961 (patch)
treef23cfaffa61efb36aa46dfeb771ad33cbfd4f3aa /hw/vga.c
parent6ad1d22b15c0a091edb1d8efc983c1d75f74ef45 (diff)
Change MMIO callbacks to use offsets, not absolute addresses.
Signed-off-by: Paul Brook <paul@codesourcery.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/vga.c')
-rw-r--r--hw/vga.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/hw/vga.c b/hw/vga.c
index 492d3f9ace..132dd0bd1a 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2263,7 +2263,7 @@ static uint32_t vga_mm_readb (void *opaque, target_phys_addr_t addr)
{
VGAState *s = opaque;
- return vga_ioport_read(s, (addr - s->base_ctrl) >> s->it_shift) & 0xff;
+ return vga_ioport_read(s, addr >> s->it_shift) & 0xff;
}
static void vga_mm_writeb (void *opaque,
@@ -2271,14 +2271,14 @@ static void vga_mm_writeb (void *opaque,
{
VGAState *s = opaque;
- vga_ioport_write(s, (addr - s->base_ctrl) >> s->it_shift, value & 0xff);
+ vga_ioport_write(s, addr >> s->it_shift, value & 0xff);
}
static uint32_t vga_mm_readw (void *opaque, target_phys_addr_t addr)
{
VGAState *s = opaque;
- return vga_ioport_read(s, (addr - s->base_ctrl) >> s->it_shift) & 0xffff;
+ return vga_ioport_read(s, addr >> s->it_shift) & 0xffff;
}
static void vga_mm_writew (void *opaque,
@@ -2286,14 +2286,14 @@ static void vga_mm_writew (void *opaque,
{
VGAState *s = opaque;
- vga_ioport_write(s, (addr - s->base_ctrl) >> s->it_shift, value & 0xffff);
+ vga_ioport_write(s, addr >> s->it_shift, value & 0xffff);
}
static uint32_t vga_mm_readl (void *opaque, target_phys_addr_t addr)
{
VGAState *s = opaque;
- return vga_ioport_read(s, (addr - s->base_ctrl) >> s->it_shift);
+ return vga_ioport_read(s, addr >> s->it_shift);
}
static void vga_mm_writel (void *opaque,
@@ -2301,7 +2301,7 @@ static void vga_mm_writel (void *opaque,
{
VGAState *s = opaque;
- vga_ioport_write(s, (addr - s->base_ctrl) >> s->it_shift, value);
+ vga_ioport_write(s, addr >> s->it_shift, value);
}
static CPUReadMemoryFunc *vga_mm_read_ctrl[] = {
@@ -2321,7 +2321,6 @@ static void vga_mm_init(VGAState *s, target_phys_addr_t vram_base,
{
int s_ioport_ctrl, vga_io_memory;
- s->base_ctrl = ctrl_base;
s->it_shift = it_shift;
s_ioport_ctrl = cpu_register_io_memory(0, vga_mm_read_ctrl, vga_mm_write_ctrl, s);
vga_io_memory = cpu_register_io_memory(0, vga_mem_read, vga_mem_write, s);