Mimic cgsix memory corruption fix (bwtwo and cgthree wscons code is

based on cgsix).  Original commit message:

  Include wsdisplay.h directly in the header to avoid different sizes
  of cgsix_softc depending on proper previous includes by the includer
  due to #ifdef NWSDISPLAY. Thanks to kmem poison check and DEBUG kernels.
This commit is contained in:
jdc 2009-02-23 22:44:27 +00:00
parent e52fb16203
commit 7262e977ee
4 changed files with 28 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bwtwo.c,v 1.21 2009/01/01 13:53:07 jdc Exp $ */
/* $NetBSD: bwtwo.c,v 1.22 2009/02/23 22:44:27 jdc Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.21 2009/01/01 13:53:07 jdc Exp $");
__KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.22 2009/02/23 22:44:27 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -96,21 +96,19 @@ __KERNEL_RCSID(0, "$NetBSD: bwtwo.c,v 1.21 2009/01/01 13:53:07 jdc Exp $");
#include <dev/sun/fbio.h>
#include <dev/sun/fbvar.h>
#include "wsdisplay.h"
#if NWSDISPLAY > 0
#include <dev/wscons/wsconsio.h>
#include <dev/wsfont/wsfont.h>
#include <dev/rasops/rasops.h>
#include <dev/wscons/wsdisplay_vconsvar.h>
#include "opt_wsemul.h"
#endif
#include <dev/sun/btreg.h>
#include <dev/sun/bwtworeg.h>
#include <dev/sun/bwtwovar.h>
#include <dev/sun/pfourreg.h>
#if NWSDISPLAY > 0
#include <dev/wscons/wsconsio.h>
#include <dev/wsfont/wsfont.h>
#include <dev/rasops/rasops.h>
#include "opt_wsemul.h"
#endif
extern struct cfdriver bwtwo_cd;
dev_type_open(bwtwoopen);

View File

@ -1,4 +1,4 @@
/* $NetBSD: bwtwovar.h,v 1.7 2008/12/05 11:52:42 jdc Exp $ */
/* $NetBSD: bwtwovar.h,v 1.8 2009/02/23 22:44:27 jdc Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -69,6 +69,9 @@
* @(#)bwtwo.c 8.1 (Berkeley) 6/11/93
*/
#include "wsdisplay.h"
#include <dev/wscons/wsdisplay_vconsvar.h>
/* per-display variables */
struct bwtwo_softc {
struct device sc_dev; /* base device */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cgthree.c,v 1.19 2009/01/01 13:53:07 jdc Exp $ */
/* $NetBSD: cgthree.c,v 1.20 2009/02/23 22:44:27 jdc Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.19 2009/01/01 13:53:07 jdc Exp $");
__KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.20 2009/02/23 22:44:27 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -56,21 +56,19 @@ __KERNEL_RCSID(0, "$NetBSD: cgthree.c,v 1.19 2009/01/01 13:53:07 jdc Exp $");
#include <dev/sun/fbio.h>
#include <dev/sun/fbvar.h>
#include "wsdisplay.h"
#if NWSDISPLAY > 0
#include <dev/wscons/wsconsio.h>
#include <dev/wsfont/wsfont.h>
#include <dev/rasops/rasops.h>
#include <dev/wscons/wsdisplay_vconsvar.h>
#include "opt_wsemul.h"
#endif
#include <dev/sun/btreg.h>
#include <dev/sun/btvar.h>
#include <dev/sun/cgthreereg.h>
#include <dev/sun/cgthreevar.h>
#if NWSDISPLAY > 0
#include <dev/wscons/wsconsio.h>
#include <dev/wsfont/wsfont.h>
#include <dev/rasops/rasops.h>
#include "opt_wsemul.h"
#endif
static void cgthreeunblank(struct device *);
static void cgthreeloadcmap(struct cgthree_softc *, int, int);
static void cgthree_set_video(struct cgthree_softc *, int);

View File

@ -1,4 +1,4 @@
/* $NetBSD: cgthreevar.h,v 1.6 2008/11/28 07:57:04 jdc Exp $ */
/* $NetBSD: cgthreevar.h,v 1.7 2009/02/23 22:44:27 jdc Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -29,6 +29,9 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "wsdisplay.h"
#include <dev/wscons/wsdisplay_vconsvar.h>
/*
* color display (cgthree) driver.
*/