summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2008-04-25 11:30:23 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2008-04-25 11:30:23 +0000
commitca91be4e3827c629bf6a507e3809cdb336b56632 (patch)
tree6959811ac356b6924cba36954474fb36e9fc8b37 /sys
parent96a9b7f1c26750efcc42065b4f5f1f2505e405d2 (diff)
the code that parses arguments from the boot loader on amd64 wasnt checking
what type of console was specified, so when a glass console was used it was still configuring serial bits. this makes it so serial config only occurs for serial console devices. found by jolan@, thib@, and maybe sthen@ sorry guys
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/machdep.c26
-rw-r--r--sys/dev/ic/com.c4
2 files changed, 16 insertions, 14 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index c6f4af19880..57ba0eed1c1 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.72 2008/04/24 12:33:14 dlg Exp $ */
+/* $OpenBSD: machdep.c,v 1.73 2008/04/25 11:30:22 dlg Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1815,18 +1815,20 @@ getbootinfo(char *bootinfo, int bootinfo_size)
(bios_consdev_t*)q->ba_arg;
#include "com.h"
#if NCOM > 0
- static const int comports[] =
+ static const int ports[] =
{ 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;
+ if (major(cdp->consdev) == 8) {
+ int unit = minor(cdp->consdev);
+ /* ic/com.c */
+ extern int comconsrate;
+ extern int comconsaddr;
+
+ if (unit >= 0 && unit <
+ (sizeof(ports) / sizeof(ports[0])))
+ comconsaddr = ports[unit];
+
+ comconsrate = cdp->conspeed;
+ }
#endif
#ifdef BOOTINFO_DEBUG
printf(" console 0x%x:%d",
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 87434c86160..53e219c86dc 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.126 2008/04/24 12:54:44 jsing Exp $ */
+/* $OpenBSD: com.c,v 1.127 2008/04/25 11:30:22 dlg Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -126,7 +126,7 @@ bus_addr_t comsiraddr;
int comconsfreq;
int comconsrate = TTYDEF_SPEED;
int comconsinit;
-bus_addr_t comconsaddr = CONADDR;
+bus_addr_t comconsaddr = 0;
int comconsattached;
bus_space_tag_t comconsiot;
bus_space_handle_t comconsioh;