summaryrefslogtreecommitdiff
path: root/sys/arch/i386/i386/bios.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/i386/i386/bios.c')
-rw-r--r--sys/arch/i386/i386/bios.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index e566d26e6bd..2b26aa58589 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.79 2008/03/29 15:26:47 krw Exp $ */
+/* $OpenBSD: bios.c,v 1.80 2008/05/21 18:49:47 kettenis Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -67,6 +67,13 @@
#include "pcibios.h"
#include "pci.h"
+#include "com.h"
+#if NCOM > 0
+#include <sys/tty.h>
+#include <dev/ic/comvar.h>
+#include <dev/ic/comreg.h>
+#endif
+
struct bios_softc {
struct device sc_dev;
};
@@ -474,12 +481,21 @@ bios_getopt()
break;
#endif
case BOOTARG_CONSDEV:
- if (q->ba_size >= sizeof(bios_consdev_t))
- {
- bios_consdev_t *cdp = (bios_consdev_t*)q->ba_arg;
-#include "com.h"
-#include "pccom.h"
-#if NCOM + NPCCOM > 0
+ if (q->ba_size >= sizeof(bios_consdev_t)) {
+ bios_consdev_t *cdp =
+ (bios_consdev_t*)q->ba_arg;
+#if NCOM > 0
+ static const int ports[] =
+ { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
+ int unit = minor(cdp->consdev);
+ if (major(cdp->consdev) == 8 && unit >= 0 &&
+ unit < (sizeof(ports)/sizeof(ports[0]))) {
+ comconsaddr = ports[unit];
+ comconsrate = cdp->conspeed;
+
+ /* Probe the serial port this time. */
+ cninit();
+ }
extern int comconsrate; /* isa/pccom.c */
comconsrate = cdp->conspeed;
#endif