summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-08-24 21:13:40 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-08-24 21:13:40 +0000
commit8d11df9e5aa58497e27e3481cca119809c76afc6 (patch)
tree0e323c75b10f8deee83950b708cb42cb989ca6e2 /hw
parent05d5818c5c9a5f90d7bc069ed1e8c9d8d77381d0 (diff)
downloadqemu-8d11df9e5aa58497e27e3481cca119809c76afc6.tar.gz
qemu-8d11df9e5aa58497e27e3481cca119809c76afc6.tar.bz2
qemu-8d11df9e5aa58497e27e3481cca119809c76afc6.zip
multiple serial port support - terminal init fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1048 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/pc.c11
-rw-r--r--hw/ppc_chrp.c2
-rw-r--r--hw/ppc_prep.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 0fd7b87b26..f59ea2397f 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -314,9 +314,12 @@ static const int ide_irq[2] = { 14, 15 };
#define NE2000_NB_MAX 6
-static uint32_t ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360, 0x280, 0x380 };
+static int ne2000_io[NE2000_NB_MAX] = { 0x300, 0x320, 0x340, 0x360, 0x280, 0x380 };
static int ne2000_irq[NE2000_NB_MAX] = { 9, 10, 11, 3, 4, 5 };
+static int serial_io[MAX_SERIAL_PORTS] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
+static int serial_irq[MAX_SERIAL_PORTS] = { 4, 3, 4, 3 };
+
/* PC hardware initialisation */
void pc_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
@@ -471,7 +474,11 @@ void pc_init(int ram_size, int vga_ram_size, int boot_device,
pic_init();
pit = pit_init(0x40, 0);
- serial_init(0x3f8, 4, serial_hd);
+ for(i = 0; i < MAX_SERIAL_PORTS; i++) {
+ if (serial_hds[i]) {
+ serial_init(serial_io[i], serial_irq[i], serial_hds[i]);
+ }
+ }
if (pci_enabled) {
for(i = 0; i < nb_nics; i++) {
diff --git a/hw/ppc_chrp.c b/hw/ppc_chrp.c
index f532fe1019..cf3a5f32fa 100644
--- a/hw/ppc_chrp.c
+++ b/hw/ppc_chrp.c
@@ -200,7 +200,7 @@ void ppc_chrp_init(int ram_size, int vga_ram_size, int boot_device,
pic_init();
/* XXX: use Mac Serial port */
- serial_init(0x3f8, 4, serial_hd);
+ serial_init(0x3f8, 4, serial_hds[0]);
for(i = 0; i < nb_nics; i++) {
pci_ne2000_init(pci_bus, &nd_table[i]);
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index eeb5a36095..c93b72faeb 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -492,7 +492,7 @@ void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
pic_init();
// pit = pit_init(0x40, 0);
- serial_init(0x3f8, 4, serial_hd);
+ serial_init(0x3f8, 4, serial_hds[0]);
nb_nics1 = nb_nics;
if (nb_nics1 > NE2000_NB_MAX)
nb_nics1 = NE2000_NB_MAX;