summaryrefslogtreecommitdiff
path: root/sys/dev/sun
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2010-09-14 18:43:41 +0000
committermacallan <macallan@NetBSD.org>2010-09-14 18:43:41 +0000
commit852bc5b43804d7af203df9434ca1acdcd445a0eb (patch)
treee2dafcbbc813db100b03cc938c9b7d69050e2f21 /sys/dev/sun
parent4abeddc6aa6f0e6762ffefc4a37f705179c8a43c (diff)
leave the screen description alone when we're not the console in order to
avoid a NULL deref later on ( which only happens on sparc64 for some reason ) While there, use VCONS_DONT_READ
Diffstat (limited to 'sys/dev/sun')
-rw-r--r--sys/dev/sun/cgthree.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sys/dev/sun/cgthree.c b/sys/dev/sun/cgthree.c
index 9abfb387953..1b955f6a23a 100644
--- a/sys/dev/sun/cgthree.c
+++ b/sys/dev/sun/cgthree.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $ */
+/* $NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.26 2009/11/25 21:10:56 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.27 2010/09/14 18:43:41 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -234,20 +234,6 @@ cgthreeattach(struct cgthree_softc *sc, const char *name, int isconsole)
* we're not the console so we just clear the screen and don't
* set up any sort of text display
*/
- if (cgthree_defaultscreen.textops == NULL) {
- /*
- * ugly, but...
- * we want the console settings to win, so we only
- * touch anything when we find an untouched screen
- * definition. In this case we fill it from fb to
- * avoid problems in case no cgthree is the console
- */
- ri = &sc->sc_fb.fb_rinfo;
- cgthree_defaultscreen.textops = &ri->ri_ops;
- cgthree_defaultscreen.capabilities = ri->ri_caps;
- cgthree_defaultscreen.nrows = ri->ri_rows;
- cgthree_defaultscreen.ncols = ri->ri_cols;
- }
}
/* Initialize the default color map. */
@@ -558,6 +544,8 @@ cgthree_init_screen(void *cookie, struct vcons_screen *scr,
struct cgthree_softc *sc = cookie;
struct rasops_info *ri = &scr->scr_ri;
+ scr->scr_flags |= VCONS_DONT_READ;
+
ri->ri_depth = 8;
ri->ri_width = sc->sc_width;
ri->ri_height = sc->sc_height;