From 8da3ff180974732fc4272cb4433fef85c1822961 Mon Sep 17 00:00:00 2001 From: pbrook Date: Mon, 1 Dec 2008 18:59:50 +0000 Subject: Change MMIO callbacks to use offsets, not absolute addresses. Signed-off-by: Paul Brook git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5849 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/parallel.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'hw/parallel.c') diff --git a/hw/parallel.c b/hw/parallel.c index 66bc715fa4..025067af6f 100644 --- a/hw/parallel.c +++ b/hw/parallel.c @@ -75,7 +75,6 @@ struct ParallelState { int epp_timeout; uint32_t last_read_offset; /* For debugging */ /* Memory-mapped interface */ - target_phys_addr_t base; int it_shift; }; @@ -477,7 +476,7 @@ static uint32_t parallel_mm_readb (void *opaque, target_phys_addr_t addr) { ParallelState *s = opaque; - return parallel_ioport_read_sw(s, (addr - s->base) >> s->it_shift) & 0xFF; + return parallel_ioport_read_sw(s, addr >> s->it_shift) & 0xFF; } static void parallel_mm_writeb (void *opaque, @@ -485,14 +484,14 @@ static void parallel_mm_writeb (void *opaque, { ParallelState *s = opaque; - parallel_ioport_write_sw(s, (addr - s->base) >> s->it_shift, value & 0xFF); + parallel_ioport_write_sw(s, addr >> s->it_shift, value & 0xFF); } static uint32_t parallel_mm_readw (void *opaque, target_phys_addr_t addr) { ParallelState *s = opaque; - return parallel_ioport_read_sw(s, (addr - s->base) >> s->it_shift) & 0xFFFF; + return parallel_ioport_read_sw(s, addr >> s->it_shift) & 0xFFFF; } static void parallel_mm_writew (void *opaque, @@ -500,14 +499,14 @@ static void parallel_mm_writew (void *opaque, { ParallelState *s = opaque; - parallel_ioport_write_sw(s, (addr - s->base) >> s->it_shift, value & 0xFFFF); + parallel_ioport_write_sw(s, addr >> s->it_shift, value & 0xFFFF); } static uint32_t parallel_mm_readl (void *opaque, target_phys_addr_t addr) { ParallelState *s = opaque; - return parallel_ioport_read_sw(s, (addr - s->base) >> s->it_shift); + return parallel_ioport_read_sw(s, addr >> s->it_shift); } static void parallel_mm_writel (void *opaque, @@ -515,7 +514,7 @@ static void parallel_mm_writel (void *opaque, { ParallelState *s = opaque; - parallel_ioport_write_sw(s, (addr - s->base) >> s->it_shift, value); + parallel_ioport_write_sw(s, addr >> s->it_shift, value); } static CPUReadMemoryFunc *parallel_mm_read_sw[] = { @@ -540,7 +539,6 @@ ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq if (!s) return NULL; parallel_reset(s, irq, chr); - s->base = base; s->it_shift = it_shift; io_sw = cpu_register_io_memory(0, parallel_mm_read_sw, parallel_mm_write_sw, s); -- cgit v1.2.3