From owner-svn-src-user@FreeBSD.ORG Sat Nov 21 17:11:52 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E3F106566B; Sat, 21 Nov 2009 17:11:52 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19B578FC1C; Sat, 21 Nov 2009 17:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nALHBpAi085837; Sat, 21 Nov 2009 17:11:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nALHBpa1085833; Sat, 21 Nov 2009 17:11:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911211711.nALHBpa1085833@svn.freebsd.org> From: Ed Schouten Date: Sat, 21 Nov 2009 17:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199640 - user/ed/newcons/sys/dev/vt X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2009 17:11:52 -0000 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