diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2008-01-23 16:37:59 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2008-01-23 16:37:59 +0000 |
commit | 7f1108670a2ba0bd92c2a3691e98bc89725e6589 (patch) | |
tree | b334068e0263bb1f8a52cc8ec13e75efc2b74092 /sys/dev | |
parent | c55bd1fde22d7d1558a234e1b9f927f4f88e19ff (diff) |
Cleanup cn_pri. Change constants to more meaningful names, rather than
the hp300 related ones currently in use. CN_NORMAL becomes CN_LOWPRI,
CN_INTERNAL becomes CN_MIDPRI and CN_REMOTE becomes CN_HIGHPRI.
ok miod@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cninit.c | 16 | ||||
-rw-r--r-- | sys/dev/cons.h | 16 | ||||
-rw-r--r-- | sys/dev/ic/com.c | 8 | ||||
-rw-r--r-- | sys/dev/wscons/wsdisplay.c | 4 |
4 files changed, 23 insertions, 21 deletions
diff --git a/sys/dev/cninit.c b/sys/dev/cninit.c index 1b4580d3baa..c4210eb56c5 100644 --- a/sys/dev/cninit.c +++ b/sys/dev/cninit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cninit.c,v 1.7 2007/09/10 17:29:00 miod Exp $ */ +/* $OpenBSD: cninit.c,v 1.8 2008/01/23 16:37:55 jsing Exp $ */ /* $NetBSD: cninit.c,v 1.2 1995/04/11 22:08:10 pk Exp $ */ /* @@ -59,21 +59,23 @@ cninit() /* * Collect information about all possible consoles - * and find the one with highest priority + * and find the one with highest priority. */ for (cp = constab; cp->cn_probe; cp++) { (*cp->cn_probe)(cp); - if (cp->cn_pri > CN_DEAD && + if (cp->cn_pri != CN_DEAD && (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri)) cn_tab = cp; } + /* - * No console, we can handle it + * No console, we can handle it. */ if ((cp = cn_tab) == NULL) return; + /* - * Turn on console + * Turn on console. */ (*cp->cn_init)(cp); } @@ -89,10 +91,10 @@ cnset(dev) */ for (cp = constab; cp->cn_probe; cp++) { if (major(cp->cn_dev) == major(dev)) { - /* short-circuit noop */ + /* Short-circuit noop. */ if (cp == cn_tab && cp->cn_dev == dev) return (0); - if (cp->cn_pri > CN_DEAD) { + if (cp->cn_pri != CN_DEAD) { cn_tab = cp; cp->cn_dev = dev; /* Turn it on. */ diff --git a/sys/dev/cons.h b/sys/dev/cons.h index cc729e6c2da..1467897403e 100644 --- a/sys/dev/cons.h +++ b/sys/dev/cons.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cons.h,v 1.15 2006/01/01 11:59:40 miod Exp $ */ +/* $OpenBSD: cons.h,v 1.16 2008/01/23 16:37:55 jsing Exp $ */ /* $NetBSD: cons.h,v 1.14 1996/03/14 19:08:35 christos Exp $ */ /* @@ -53,15 +53,15 @@ struct consdev { /* ring bell */ void (*cn_bell)(dev_t, u_int, u_int, u_int); dev_t cn_dev; /* major/minor of device */ - int cn_pri; /* picking order; the higher the better */ + u_int cn_pri; /* picking order; the higher the better */ }; -/* values for cn_pri - reflect our policy for console selection */ -#define CN_DEAD 0 /* device doesn't exist */ -#define CN_NORMAL 1 /* device exists but is nothing special */ -#define CN_INTERNAL 2 /* "internal" bit-mapped display */ -#define CN_REMOTE 3 /* serial interface with remote bit set */ -#define CN_FORCED 4 +/* Values for cn_pri - policy for console selection. */ +#define CN_DEAD 0 /* Device does not exist. */ +#define CN_LOWPRI 1 /* Device exists and is low priority. */ +#define CN_MIDPRI 2 /* Device exists and is medium priority. */ +#define CN_HIGHPRI 3 /* Device exists and is high priority. */ +#define CN_FORCED 4 /* Use this device. */ /* XXX */ #define CONSMAJOR 0 diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 634ab9401ce..2ed5b36e0fe 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.120 2008/01/12 13:32:23 miod Exp $ */ +/* $OpenBSD: com.c,v 1.121 2008/01/23 16:37:55 jsing Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -1354,9 +1354,9 @@ comcnprobe(struct consdev *cp) /* initialize required fields */ cp->cn_dev = makedev(commajor, CONUNIT); #if defined(COMCONSOLE) || defined(PCCOMCONSOLE) || !defined(__amd64__) - cp->cn_pri = CN_REMOTE; + cp->cn_pri = CN_HIGHPRI; #else - cp->cn_pri = CN_NORMAL; + cp->cn_pri = CN_LOWPRI; #endif } @@ -1381,7 +1381,7 @@ comcnattach(bus_space_tag_t iot, bus_addr_t iobase, int rate, int frequency, tcf { static struct consdev comcons = { NULL, NULL, comcngetc, comcnputc, comcnpollc, NULL, - NODEV, CN_NORMAL + NODEV, CN_LOWPRI }; #ifndef __sparc64__ diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index e89b5249496..f2f0f9ebca8 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.84 2007/11/26 16:56:41 miod Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.85 2008/01/23 16:37:55 jsing Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -250,7 +250,7 @@ void (*wsdisplay_cons_kbd_pollc)(dev_t, int); struct consdev wsdisplay_cons = { NULL, NULL, wsdisplay_getc_dummy, wsdisplay_cnputc, - wsdisplay_pollc, NULL, NODEV, CN_NORMAL + wsdisplay_pollc, NULL, NODEV, CN_LOWPRI }; #ifndef WSDISPLAY_DEFAULTSCREENS |