summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2008-04-24 12:33:14 +0000
committerdlg <dlg@openbsd.org>2008-04-24 12:33:14 +0000
commite4a67c90d75aa3c68607ba126dd2c9f9008da25f (patch)
tree4ba78590ffbdb66cd575d9bf67ce5a190c3fd27a /sys
parentCleanup serial console handling and remove some of the MD code from com.c. (diff)
downloadwireguard-openbsd-e4a67c90d75aa3c68607ba126dd2c9f9008da25f.tar.xz
wireguard-openbsd-e4a67c90d75aa3c68607ba126dd2c9f9008da25f.zip
allow amd64 to use serial ports other than com0 as the console. previously
it was stuck to com0 no matter what the boot loader told the kernel. this relies on the com diff jsing just committed.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/machdep.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 59ba69927a3..c6f4af19880 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.71 2008/04/12 12:49:28 kettenis Exp $ */
+/* $OpenBSD: machdep.c,v 1.72 2008/04/24 12:33:14 dlg Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1810,13 +1810,22 @@ getbootinfo(char *bootinfo, int bootinfo_size)
#endif
#endif
case BOOTARG_CONSDEV:
- if (q->ba_size >= sizeof(bios_consdev_t))
- {
+ if (q->ba_size >= sizeof(bios_consdev_t)) {
bios_consdev_t *cdp =
(bios_consdev_t*)q->ba_arg;
#include "com.h"
#if NCOM > 0
- extern int comconsrate; /* ic/com.c */
+ static const int comports[] =
+ { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
+ int unit = minor(cdp->consdev);
+ /* ic/com.c */
+ extern int comconsrate;
+ extern int comconsaddr;
+
+ if (unit >= 0 && unit < (sizeof(comports) /
+ sizeof(comports[0])))
+ comconsaddr = comports[unit];
+
comconsrate = cdp->conspeed;
#endif
#ifdef BOOTINFO_DEBUG