PERFORCE change 37047 for review
Marcel Moolenaar
marcel at FreeBSD.org
Wed Aug 27 16:34:36 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37047
Change 37047 by marcel at marcel_nfs on 2003/08/27 16:34:04
Rename the consdev field in struct uart_devinfo to
cookie. This makes it clear that it can be used by
any system device for whatever purpose they see fit.
While here, make uart_console static.
Affected files ...
.. //depot/projects/uart/dev/uart/uart_cpu.h#6 edit
.. //depot/projects/uart/dev/uart/uart_tty.c#8 edit
Differences ...
==== //depot/projects/uart/dev/uart/uart_cpu.h#6 (text+ko) ====
@@ -62,7 +62,7 @@
#define UART_DEV_KEYBOARD 2
int (*attach)(struct uart_softc*);
int (*detach)(struct uart_softc*);
- void *consdev; /* Yedi trick. See uart_cons.c */
+ void *cookie; /* Type dependent use. */
};
int uart_cpu_getdev(int devtype, struct uart_devinfo *di);
==== //depot/projects/uart/dev/uart/uart_tty.c#8 (text+ko) ====
@@ -79,7 +79,7 @@
.d_kqfilter = ttykqfilter,
};
-struct uart_devinfo uart_console;
+static struct uart_devinfo uart_console;
static void
uart_cnprobe(struct consdev *cp)
@@ -88,7 +88,7 @@
cp->cn_dev = NULL;
cp->cn_pri = CN_DEAD;
- KASSERT(uart_console.consdev == NULL, ("foo"));
+ KASSERT(uart_console.cookie == NULL, ("foo"));
if (uart_cpu_getdev(UART_DEV_CONSOLE, &uart_console))
return;
@@ -115,8 +115,8 @@
* the unit number will be.
*/
di = cp->cn_arg;
- KASSERT(di->consdev == NULL, ("foo"));
- di->consdev = cp;
+ KASSERT(di->cookie == NULL, ("foo"));
+ di->cookie = cp;
di->type = UART_DEV_CONSOLE;
uart_add_sysdev(di);
uart_init(di);
@@ -313,7 +313,7 @@
tp->t_stop = uart_tty_stop;
if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) {
- ((struct consdev *)sc->sc_sysdev->consdev)->cn_dev =
+ ((struct consdev *)sc->sc_sysdev->cookie)->cn_dev =
makedev(uart_cdevsw.d_maj, device_get_unit(sc->sc_dev));
}
More information about the p4-projects
mailing list