diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-18 14:08:04 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-18 14:08:04 +0000 |
commit | ceecf1d158d324c61a7ec1ba5de57dbc8a0f8373 (patch) | |
tree | bb58577711ef3fedae6ebbe731ac4da7f2d85bde /hw/mips_malta.c | |
parent | 9c554c1c0b01642c39232489cef8301a7858824d (diff) |
add an init function parameter to qemu_chr_open()
And use it for the malta emulation. Fix segfault introduced in
revision 6352.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6365 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mips_malta.c')
-rw-r--r-- | hw/mips_malta.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/hw/mips_malta.c b/hw/mips_malta.c index 42f77f1eef..42169bf328 100644 --- a/hw/mips_malta.c +++ b/hw/mips_malta.c @@ -418,7 +418,24 @@ static void malta_fpga_reset(void *opaque) s->display_text[8] = '\0'; snprintf(s->display_text, 9, " "); - malta_fpga_update_display(s); +} + +static void malta_fpga_uart_init(CharDriverState *chr) +{ + qemu_chr_printf(chr, "CBUS UART\r\n"); +} + +static void malta_fpga_led_init(CharDriverState *chr) +{ + qemu_chr_printf(chr, "\e[HMalta LEDBAR\r\n"); + qemu_chr_printf(chr, "+--------+\r\n"); + qemu_chr_printf(chr, "+ +\r\n"); + qemu_chr_printf(chr, "+--------+\r\n"); + qemu_chr_printf(chr, "\n"); + qemu_chr_printf(chr, "Malta ASCII\r\n"); + qemu_chr_printf(chr, "+--------+\r\n"); + qemu_chr_printf(chr, "+ +\r\n"); + qemu_chr_printf(chr, "+--------+\r\n"); } static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, CPUState *env) @@ -436,19 +453,9 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, CPUState *env) /* 0xa00 is less than a page, so will still get the right offsets. */ cpu_register_physical_memory(base + 0xa00, 0x100000 - 0xa00, malta); - s->display = qemu_chr_open("fpga", "vc:320x200"); - qemu_chr_printf(s->display, "\e[HMalta LEDBAR\r\n"); - qemu_chr_printf(s->display, "+--------+\r\n"); - qemu_chr_printf(s->display, "+ +\r\n"); - qemu_chr_printf(s->display, "+--------+\r\n"); - qemu_chr_printf(s->display, "\n"); - qemu_chr_printf(s->display, "Malta ASCII\r\n"); - qemu_chr_printf(s->display, "+--------+\r\n"); - qemu_chr_printf(s->display, "+ +\r\n"); - qemu_chr_printf(s->display, "+--------+\r\n"); - - uart_chr = qemu_chr_open("cbus", "vc:80Cx24C"); - qemu_chr_printf(uart_chr, "CBUS UART\r\n"); + s->display = qemu_chr_open("fpga", "vc:320x200", malta_fpga_led_init); + + uart_chr = qemu_chr_open("cbus", "vc:80Cx24C", malta_fpga_uart_init); s->uart = serial_mm_init(base + 0x900, 3, env->irq[2], 230400, uart_chr, 1); |