summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-06-08 13:55:07 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-06-08 13:55:07 +0000
commitd177b1d3680c458f6fe4c70d0f20089ab8965c46 (patch)
tree271b65f8d039134dbd4d34354099acad5e2f7a13 /sys
parentee05241691270f1ae40e071f28c08d4ed2eb8002 (diff)
Make serial console on non-primary ports work to on i386.
tested by jbg@, "it is right" deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/machdep.c3
-rw-r--r--sys/arch/i386/i386/bios.c5
-rw-r--r--sys/dev/ic/com.c5
-rw-r--r--sys/dev/ic/comreg.h6
-rw-r--r--sys/dev/ic/comvar.h3
5 files changed, 10 insertions, 12 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 71905848f35..31b5191e448 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.76 2008/06/02 11:46:19 jsg Exp $ */
+/* $OpenBSD: machdep.c,v 1.77 2008/06/08 13:55:06 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1815,6 +1815,7 @@ getbootinfo(char *bootinfo, int bootinfo_size)
int unit = minor(cdp->consdev);
if (major(cdp->consdev) == 8 && unit >= 0 &&
unit < (sizeof(ports)/sizeof(ports[0]))) {
+ comconsunit = unit;
comconsaddr = ports[unit];
comconsrate = cdp->conspeed;
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index 2b26aa58589..b12fbe7407d 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.80 2008/05/21 18:49:47 kettenis Exp $ */
+/* $OpenBSD: bios.c,v 1.81 2008/06/08 13:55:06 kettenis Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -490,14 +490,13 @@ bios_getopt()
int unit = minor(cdp->consdev);
if (major(cdp->consdev) == 8 && unit >= 0 &&
unit < (sizeof(ports)/sizeof(ports[0]))) {
+ comconsunit = unit;
comconsaddr = ports[unit];
comconsrate = cdp->conspeed;
/* Probe the serial port this time. */
cninit();
}
- extern int comconsrate; /* isa/pccom.c */
- comconsrate = cdp->conspeed;
#endif
#ifdef BIOS_DEBUG
printf(" console 0x%x:%d",
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 53e219c86dc..7e9ccbbdcce 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.127 2008/04/25 11:30:22 dlg Exp $ */
+/* $OpenBSD: com.c,v 1.128 2008/06/08 13:55:06 kettenis Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*
@@ -130,6 +130,7 @@ bus_addr_t comconsaddr = 0;
int comconsattached;
bus_space_tag_t comconsiot;
bus_space_handle_t comconsioh;
+int comconsunit;
tcflag_t comconscflag = TTYDEF_CFLAG;
#endif
@@ -1336,7 +1337,7 @@ comcnprobe(struct consdev *cp)
break;
/* Initialize required fields. */
- cp->cn_dev = makedev(commajor, CONUNIT);
+ cp->cn_dev = makedev(commajor, comconsunit);
#if defined(COMCONSOLE) || defined(PCCOMCONSOLE) || !defined(__amd64__)
cp->cn_pri = CN_HIGHPRI;
#else
diff --git a/sys/dev/ic/comreg.h b/sys/dev/ic/comreg.h
index 8c2c9841db0..60846988f46 100644
--- a/sys/dev/ic/comreg.h
+++ b/sys/dev/ic/comreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: comreg.h,v 1.15 2006/07/31 11:06:30 mickey Exp $ */
+/* $OpenBSD: comreg.h,v 1.16 2008/06/08 13:55:06 kettenis Exp $ */
/* $NetBSD: comreg.h,v 1.8 1996/02/05 23:01:50 scottr Exp $ */
/*
@@ -188,13 +188,9 @@
/*
* WARNING: Serial console is assumed to be at COM1 address
- * and CONUNIT must be 0.
*/
#ifndef CONADDR
#define CONADDR (0x3f8)
#else
#define CONADDR_OVERRIDE
#endif
-#ifndef CONUNIT
-#define CONUNIT (0)
-#endif
diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h
index c629d3d89c7..339cad8b45d 100644
--- a/sys/dev/ic/comvar.h
+++ b/sys/dev/ic/comvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: comvar.h,v 1.44 2008/04/30 13:59:32 dlg Exp $ */
+/* $OpenBSD: comvar.h,v 1.45 2008/06/08 13:55:06 kettenis Exp $ */
/* $NetBSD: comvar.h,v 1.5 1996/05/05 19:50:47 christos Exp $ */
/*
@@ -181,4 +181,5 @@ extern int comconsinit;
extern int comconsattached;
extern bus_space_tag_t comconsiot;
extern bus_space_handle_t comconsioh;
+extern int comconsunit;
extern tcflag_t comconscflag;