diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-01 18:59:50 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-01 18:59:50 +0000 |
commit | 8da3ff180974732fc4272cb4433fef85c1822961 (patch) | |
tree | f23cfaffa61efb36aa46dfeb771ad33cbfd4f3aa /hw/jazz_led.c | |
parent | 6ad1d22b15c0a091edb1d8efc983c1d75f74ef45 (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/jazz_led.c')
-rw-r--r-- | hw/jazz_led.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/hw/jazz_led.c b/hw/jazz_led.c index c8ac26372f..a3aaec7a0c 100644 --- a/hw/jazz_led.c +++ b/hw/jazz_led.c @@ -34,7 +34,6 @@ typedef enum { } screen_state_t; typedef struct LedState { - target_phys_addr_t base; uint8_t segments; DisplayState *ds; QEMUConsole *console; @@ -44,10 +43,9 @@ typedef struct LedState { static uint32_t led_readb(void *opaque, target_phys_addr_t addr) { LedState *s = opaque; - int relative_addr = addr - s->base; uint32_t val; - switch (relative_addr) { + switch (addr) { case 0: val = s->segments; break; @@ -94,9 +92,8 @@ static uint32_t led_readl(void *opaque, target_phys_addr_t addr) static void led_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) { LedState *s = opaque; - int relative_addr = addr - s->base; - switch (relative_addr) { + switch (addr) { case 0: s->segments = val; s->state |= REDRAW_SEGMENTS; @@ -311,12 +308,11 @@ void jazz_led_init(DisplayState *ds, target_phys_addr_t base) if (!s) return; - s->base = base; s->ds = ds; s->state = REDRAW_SEGMENTS | REDRAW_BACKGROUND; io = cpu_register_io_memory(0, led_read, led_write, s); - cpu_register_physical_memory(s->base, 1, io); + cpu_register_physical_memory(base, 1, io); s->console = graphic_console_init(ds, jazz_led_update_display, jazz_led_invalidate_display, |