svn commit: r199640 - user/ed/newcons/sys/dev/vt

Ed Schouten ed at FreeBSD.org
Sat Nov 21 17:11:52 UTC 2009


Author: ed
Date: Sat Nov 21 17:11:51 2009
New Revision: 199640
URL: http://svn.freebsd.org/changeset/base/199640

Log:
  Tidy up this code a bit.
  
  Add VBM_DIRTY that we can use throughout the code to serve as a dirty
  mask for rows/columns.

Modified:
  user/ed/newcons/sys/dev/vt/vt.h
  user/ed/newcons/sys/dev/vt/vt_buf.c
  user/ed/newcons/sys/dev/vt/vt_core.c

Modified: user/ed/newcons/sys/dev/vt/vt.h
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt.h	Sat Nov 21 17:01:38 2009	(r199639)
+++ user/ed/newcons/sys/dev/vt/vt.h	Sat Nov 21 17:11:51 2009	(r199640)
@@ -99,6 +99,7 @@ struct vt_device {
 
 struct vt_bufmask {
 	uint64_t		 vbm_row, vbm_col;
+#define	VBM_DIRTY		UINT64_MAX
 };
 
 struct vt_buf {

Modified: user/ed/newcons/sys/dev/vt/vt_buf.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_buf.c	Sat Nov 21 17:01:38 2009	(r199639)
+++ user/ed/newcons/sys/dev/vt/vt_buf.c	Sat Nov 21 17:11:51 2009	(r199640)
@@ -44,8 +44,6 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", "
 #define	VTBUF_LOCK(vb)		mtx_lock_spin(&(vb)->vb_lock)
 #define	VTBUF_UNLOCK(vb)	mtx_unlock_spin(&(vb)->vb_lock)
 
-#define	ALLBITS			((uint64_t)~0)
-
 static inline uint64_t
 vtbuf_dirty_axis(unsigned int begin, unsigned int end)
 {
@@ -61,12 +59,12 @@ vtbuf_dirty_axis(unsigned int begin, uns
 
 	/* Obvious case. Mark everything dirty. */
 	if (end - begin >= 64)
-		return (ALLBITS);
+		return (VBM_DIRTY);
 
 	/* 1....0; used bits on the left. */
-	left = ALLBITS << begin % 64;
+	left = VBM_DIRTY << begin % 64;
 	/* 0....1; used bits on the right. */
-	right = ALLBITS >> -end % 64;
+	right = VBM_DIRTY >> -end % 64;
 
 	/*
 	 * Only take the intersection.  If the result of that is 0, it

Modified: user/ed/newcons/sys/dev/vt/vt_core.c
==============================================================================
--- user/ed/newcons/sys/dev/vt/vt_core.c	Sat Nov 21 17:01:38 2009	(r199639)
+++ user/ed/newcons/sys/dev/vt/vt_core.c	Sat Nov 21 17:11:51 2009	(r199640)
@@ -505,7 +505,7 @@ vt_flush(struct vt_device *vd)
 	if (vd->vd_scrollpos != scrollpos || vd->vd_flags & VDF_INVALID) {
 		tarea.tr_begin.tp_row = tarea.tr_begin.tp_col = 0;
 		tarea.tr_end = size;
-		tmask.vbm_row = tmask.vbm_col = ~0;
+		tmask.vbm_row = tmask.vbm_col = VBM_DIRTY;
 
 		/*
 		 * Blank to prevent borders with artifacts.  This is


More information about the svn-src-user mailing list