Commit 7bcc17dc020d49f0baf25010f3d2be41ebfe238f

Authored by ths
1 parent 331ad6f4

Fix initialisation of serial/parallel ports, spotted by Stefan Weil.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2447 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 3 deletions
hw/mips_malta.c
@@ -569,9 +569,12 @@ void mips_malta_init (int ram_size, int vga_ram_size, int boot_device, @@ -569,9 +569,12 @@ void mips_malta_init (int ram_size, int vga_ram_size, int boot_device,
569 /* Super I/O */ 569 /* Super I/O */
570 kbd_init(); 570 kbd_init();
571 rtc_state = rtc_init(0x70, 8); 571 rtc_state = rtc_init(0x70, 8);
572 - serial_init(&pic_set_irq_new, isa_pic, 0x3f8, 4, serial_hds[0]);  
573 - serial_init(&pic_set_irq_new, isa_pic, 0x2f8, 4, serial_hds[0]);  
574 - parallel_init(0x378, 7, parallel_hds[0]); 572 + if (serial_hds[0])
  573 + serial_init(&pic_set_irq_new, isa_pic, 0x3f8, 4, serial_hds[0]);
  574 + if (serial_hds[1])
  575 + serial_init(&pic_set_irq_new, isa_pic, 0x2f8, 4, serial_hds[1]);
  576 + if (parallel_hds[0])
  577 + parallel_init(0x378, 7, parallel_hds[0]);
575 /* XXX: The floppy controller does not work correctly, something is 578 /* XXX: The floppy controller does not work correctly, something is
576 probably wrong. 579 probably wrong.
577 floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table); */ 580 floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table); */