Subject: Re: kern/8628: Garbage can move between virtual terminals?
To: Richard Rauch <rkr@olib.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 01/25/2004 03:00:37
--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

The attached patch seems to fix the problem of copying data from one
VT to another whilst scrolling. It's surely overkill because you only
need to lock against a VT switch and I'm not sure whether only 
scrolling can cause characters appearing on the wrong VT.

-- 
Christian

--mojUlQ0s9EVzWg2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wsemul_vt100_subr.c.udif"

Index: wsemul_vt100_subr.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsemul_vt100_subr.c,v
retrieving revision 1.14
diff -u -r1.14 wsemul_vt100_subr.c
--- wsemul_vt100_subr.c	2003/04/02 18:22:56	1.14
+++ wsemul_vt100_subr.c	2004/01/25 01:52:50
@@ -60,7 +60,9 @@
 wsemul_vt100_scrollup(struct wsemul_vt100_emuldata *edp, int n)
 {
 	int help;
+	int x;
 
+	x = spltty();
 	if (n > edp->scrreg_nrows)
 		n = edp->scrreg_nrows;
 
@@ -81,6 +83,7 @@
 	if (edp->dblwid)
 		memset(&edp->dblwid[edp->scrreg_startrow + help], 0, n);
 	CHECK_DW;
+	splx(x);
 }
 
 /*
@@ -90,7 +93,9 @@
 wsemul_vt100_scrolldown(struct wsemul_vt100_emuldata *edp, int n)
 {
 	int help;
+	int x;
 
+	x = spltty();
 	if (n > edp->scrreg_nrows)
 		n = edp->scrreg_nrows;
 
@@ -111,6 +116,7 @@
 	if (edp->dblwid)
 		memset(&edp->dblwid[edp->scrreg_startrow], 0, n);
 	CHECK_DW;
+        splx(x);
 }
 
 /*

--mojUlQ0s9EVzWg2t--