summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2013-09-29 12:56:31 +0000
committerkettenis <kettenis@openbsd.org>2013-09-29 12:56:31 +0000
commit9159c36eabb05309442efa36037c76da4562045e (patch)
tree784598a4e07d30a7d1d00baf804003e3f646cd04
parentPerform more consistency checks when walking the VDIT. (diff)
downloadwireguard-openbsd-9159c36eabb05309442efa36037c76da4562045e.tar.xz
wireguard-openbsd-9159c36eabb05309442efa36037c76da4562045e.zip
Get rid of cnset(). It is only used on amd64/i386 and doesn't really do
anything useful there. Switching from glass console to serial console is already done by cninit(), and the reinitializaton of cn_tab by cnset() breaks the conseleness checks in the wsdisplay code. Tested on various amd64/i386 systems with both glass and serial console. ok mpi@
-rw-r--r--sys/arch/amd64/amd64/machdep.c3
-rw-r--r--sys/arch/i386/i386/bios.c3
-rw-r--r--sys/dev/cninit.c28
-rw-r--r--sys/dev/cons.h3
4 files changed, 4 insertions, 33 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index b4fa7a5c529..352b9045751 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.166 2013/09/28 12:40:28 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.167 2013/09/29 12:56:31 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1852,7 +1852,6 @@ getbootinfo(char *bootinfo, int bootinfo_size)
printf(" console 0x%x:%d",
cdp->consdev, cdp->conspeed);
#endif
- cnset(cdp->consdev);
}
break;
case BOOTARG_BOOTMAC:
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index 6e46e6a495f..555b442948d 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.99 2013/04/24 08:23:45 blambert Exp $ */
+/* $OpenBSD: bios.c,v 1.100 2013/09/29 12:56:31 kettenis Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -573,7 +573,6 @@ bios_getopt()
printf(" console 0x%x:%d",
cdp->consdev, cdp->conspeed);
#endif
- cnset(cdp->consdev);
}
break;
#ifdef MULTIPROCESSOR
diff --git a/sys/dev/cninit.c b/sys/dev/cninit.c
index dcde72f1794..11fa949ae6b 100644
--- a/sys/dev/cninit.c
+++ b/sys/dev/cninit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cninit.c,v 1.11 2011/06/23 16:02:33 tedu Exp $ */
+/* $OpenBSD: cninit.c,v 1.12 2013/09/29 12:56:31 kettenis Exp $ */
/* $NetBSD: cninit.c,v 1.2 1995/04/11 22:08:10 pk Exp $ */
/*
@@ -80,29 +80,3 @@ cninit(void)
*/
(*cp->cn_init)(cp);
}
-
-int
-cnset(dev_t dev)
-{
- struct consdev *cp;
-
- /*
- * Look for the specified console device and use it.
- */
- for (cp = constab; cp->cn_probe; cp++) {
- if (major(cp->cn_dev) == major(dev)) {
- /* Short-circuit noop. */
- if (cp == cn_tab && cp->cn_dev == dev)
- return (0);
- if (cp->cn_pri != CN_DEAD) {
- cn_tab = cp;
- cp->cn_dev = dev;
- /* Turn it on. */
- (*cp->cn_init)(cp);
- return (0);
- }
- break;
- }
- }
- return (1);
-}
diff --git a/sys/dev/cons.h b/sys/dev/cons.h
index 1467897403e..2aebc734339 100644
--- a/sys/dev/cons.h
+++ b/sys/dev/cons.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cons.h,v 1.16 2008/01/23 16:37:55 jsing Exp $ */
+/* $OpenBSD: cons.h,v 1.17 2013/09/29 12:56:31 kettenis Exp $ */
/* $NetBSD: cons.h,v 1.14 1996/03/14 19:08:35 christos Exp $ */
/*
@@ -74,7 +74,6 @@ extern struct consdev *cn_tab;
struct knote;
void cninit(void);
-int cnset(dev_t);
int cnopen(dev_t, int, int, struct proc *);
int cnclose(dev_t, int, int, struct proc *);
int cnread(dev_t, struct uio *, int);