summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa/pccom.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-12-23 17:50:25 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-12-23 17:50:25 +0000
commit3a940ca2a75e83e0d9495b3bfe79d40558be6476 (patch)
treea2acdfa68c5519a4281a169dc545cf467fbebe95 /sys/arch/i386/isa/pccom.c
parent67ef202a25aac6aae8bb74628a3080c3fe0441dd (diff)
make com[123] work for console on i386, but allow override with CONADDR/CONUNIT
ok mickey, deraadt
Diffstat (limited to 'sys/arch/i386/isa/pccom.c')
-rw-r--r--sys/arch/i386/isa/pccom.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c
index d5bb57fbf25..09d9eea6bd0 100644
--- a/sys/arch/i386/isa/pccom.c
+++ b/sys/arch/i386/isa/pccom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccom.c,v 1.45 2003/10/03 16:44:49 miod Exp $ */
+/* $OpenBSD: pccom.c,v 1.46 2004/12/23 17:50:24 markus Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -1947,7 +1947,18 @@ comcninit(cp)
XXX NEEDS TO BE FIXED XXX
comconsiot = ???;
#endif
+
+#ifdef CONADDR_OVERRIDE
comconsaddr = CONADDR;
+#else
+ const int comports[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
+ int unit = minor(cp->cn_dev);
+
+ if (unit >= 0 && unit < 4)
+ comconsaddr = comports[unit];
+ else
+ comconsaddr = CONADDR;
+#endif
if (bus_space_map(comconsiot, comconsaddr, COM_NPORTS, 0, &comconsioh))
panic("comcninit: mapping failed");