diff options
Diffstat (limited to 'sys/arch/hp300/dev/rbox.c')
-rw-r--r-- | sys/arch/hp300/dev/rbox.c | 95 |
1 files changed, 2 insertions, 93 deletions
diff --git a/sys/arch/hp300/dev/rbox.c b/sys/arch/hp300/dev/rbox.c index 4d17431e8cd..92951682cbc 100644 --- a/sys/arch/hp300/dev/rbox.c +++ b/sys/arch/hp300/dev/rbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rbox.c,v 1.12 2005/12/30 18:14:09 miod Exp $ */ +/* $OpenBSD: rbox.c,v 1.13 2005/12/31 18:13:41 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -83,8 +83,6 @@ #include <hp300/dev/diodevs.h> #include <hp300/dev/intiovar.h> -#include <dev/cons.h> - #include <dev/wscons/wsconsio.h> #include <dev/wscons/wsdisplayvar.h> #include <dev/rasops/rasops.h> @@ -383,97 +381,8 @@ rbox_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy, * Renaissance console support */ -int rbox_console_scan(int, caddr_t, void *); -cons_decl(rbox); - -int -rbox_console_scan(int scode, caddr_t va, void *arg) -{ - struct diofbreg *fbr = (struct diofbreg *)va; - struct consdev *cp = arg; - u_int pri; - - if (fbr->id != GRFHWID || fbr->fbid != GID_RENAISSANCE) - return (0); - - pri = CN_NORMAL; - -#ifdef CONSCODE - /* - * Raise our priority, if appropriate. - */ - if (scode == CONSCODE) - pri = CN_FORCED; -#endif - - /* Only raise priority. */ - if (pri > cp->cn_pri) - cp->cn_pri = pri; - - /* - * If our priority is higher than the currently-remembered - * console, stash our priority. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - conscode = scode; - return (DIO_SIZE(scode, va)); - } - return (0); -} - -void -rboxcnprobe(struct consdev *cp) -{ - int maj; - caddr_t va; - struct diofbreg *fbr; - - for (maj = 0; maj < nchrdev; maj++) { - if (cdevsw[maj].d_open == wsdisplayopen) - break; - } - - if (maj == nchrdev) - return; - - cp->cn_dev = makedev(maj, 0); - cp->cn_pri = CN_DEAD; - - /* Look for "internal" framebuffer. */ - va = (caddr_t)IIOV(GRFIADDR); - fbr = (struct diofbreg *)va; - if (!badaddr(va) && - fbr->id == GRFHWID && fbr->fbid == GID_RENAISSANCE) { - cp->cn_pri = CN_INTERNAL; - -#ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) - cp->cn_pri = CN_FORCED; -#endif - - /* - * If our priority is higher than the currently - * remembered console, stash our priority, and - * unmap whichever device might be currently mapped. - * Since we're internal, we set the saved size to 0 - * so they don't attempt to unmap our fixed VA later. - */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { - cn_tab = cp; - if (convasize) - iounmap(conaddr, convasize); - conscode = CONSCODE_INTERNAL; - conaddr = va; - convasize = 0; - } - } - - console_scan(rbox_console_scan, cp, HP300_BUS_DIO); -} - void -rboxcninit(struct consdev *cp) +rboxcninit() { rbox_reset(&diofb_cn, conscode, (struct diofbreg *)conaddr); diofb_cnattach(&diofb_cn); |