Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Nov 2009 17:11:51 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r199640 - user/ed/newcons/sys/dev/vt
Message-ID:  <200911211711.nALHBpa1085833@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911211711.nALHBpa1085833>