Module Name: src
Committed By: macallan
Date: Tue Sep 14 18:43:41 UTC 2010
Modified Files:
src/sys/dev/sun: cgthree.c
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/sun/cgthree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/sun/cgthree.c
diff -u src/sys/dev/sun/cgthree.c:1.26 src/sys/dev/sun/cgthree.c:1.27
--- src/sys/dev/sun/cgthree.c:1.26 Wed Nov 25 21:10:56 2009
+++ src/sys/dev/sun/cgthree.c Tue Sep 14 18:43:41 2010
@@ -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 @@
* 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 @@
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;