diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-26 17:39:43 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-05-26 17:39:43 +0000 |
commit | 5aca8c3b2fbada188ff86781fba24685d346cef9 (patch) | |
tree | d3cc0526e7c45b23dfddf42a123d4261f87a93b4 /hw/slavio_serial.c | |
parent | db7b5426a4b424249b4aba3496bf14da69a6625b (diff) |
Split DMA controller in two
Fix register size related bugs
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2869 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/slavio_serial.c')
-rw-r--r-- | hw/slavio_serial.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/slavio_serial.c b/hw/slavio_serial.c index 3da40eb6cf..0a2c873300 100644 --- a/hw/slavio_serial.c +++ b/hw/slavio_serial.c @@ -102,6 +102,7 @@ struct SerialState { }; #define SERIAL_MAXADDR 7 +#define SERIAL_SIZE (SERIAL_MAXADDR + 1) static void handle_kbd_command(ChannelState *s, int val); static int serial_can_receive(void *opaque); @@ -178,7 +179,7 @@ static void slavio_serial_reset_chn(ChannelState *s) int i; s->reg = 0; - for (i = 0; i < SERIAL_MAXADDR; i++) { + for (i = 0; i < SERIAL_SIZE; i++) { s->rregs[i] = 0; s->wregs[i] = 0; } @@ -598,7 +599,7 @@ SerialState *slavio_serial_init(target_phys_addr_t base, qemu_irq irq, return NULL; slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s); - cpu_register_physical_memory(base, SERIAL_MAXADDR, slavio_serial_io_memory); + cpu_register_physical_memory(base, SERIAL_SIZE, slavio_serial_io_memory); s->chn[0].chr = chr1; s->chn[1].chr = chr2; @@ -723,7 +724,7 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq) s->chn[1].type = kbd; slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s); - cpu_register_physical_memory(base, SERIAL_MAXADDR, slavio_serial_io_memory); + cpu_register_physical_memory(base, SERIAL_SIZE, slavio_serial_io_memory); qemu_add_mouse_event_handler(sunmouse_event, &s->chn[0], 0, "QEMU Sun Mouse"); qemu_add_kbd_event_handler(sunkbd_event, &s->chn[1]); |