From owner-p4-projects@FreeBSD.ORG Wed Sep 17 20:14:59 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 376101065688; Wed, 17 Sep 2008 20:14:59 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D868D1065684 for ; Wed, 17 Sep 2008 20:14:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C66DA8FC1D for ; Wed, 17 Sep 2008 20:14:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m8HKEwrM062894 for ; Wed, 17 Sep 2008 20:14:58 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m8HKEwjR062892 for perforce@freebsd.org; Wed, 17 Sep 2008 20:14:58 GMT (envelope-from ed@FreeBSD.org) Date: Wed, 17 Sep 2008 20:14:58 GMT Message-Id: <200809172014.m8HKEwjR062892@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 149955 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 20:14:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=149955 Change 149955 by ed@ed_dull on 2008/09/17 20:14:44 See what happens if we remove quote bits from clists. These bits were only used back in the days when our TTY's used clists. Affected files ... .. //depot/projects/mpsafetty/sys/kern/subr_clist.c#3 edit .. //depot/projects/mpsafetty/sys/sys/clist.h#2 edit .. //depot/projects/mpsafetty/sys/sys/param.h#11 edit Differences ... ==== //depot/projects/mpsafetty/sys/kern/subr_clist.c#3 (text+ko) ==== @@ -52,8 +52,6 @@ #define INITIAL_CBLOCKS 50 #endif -#define QUOTEMASK 0x100 - static struct cblock *cblock_alloc(void); static void cblock_alloc_cblocks(int number); static void cblock_free(struct cblock *cblockp); @@ -118,8 +116,6 @@ cblock_free(cblockp) struct cblock *cblockp; { - if (isset(cblockp->c_quote, CBQSIZE * NBBY - 1)) - bzero(cblockp->c_quote, sizeof cblockp->c_quote); cblockp->c_next = cfreelist; cfreelist = cblockp; cfreecount += CBSIZE; @@ -146,7 +142,6 @@ * Freed cblocks have zero quotes and garbage elsewhere. * Set the may-have-quote bit to force zeroing the quotes. */ - setbit(cbp->c_quote, CBQSIZE * NBBY - 1); cblock_free(cbp); } ctotcount += number; @@ -233,12 +228,6 @@ chr = (u_char)*clistp->c_cf; /* - * If this char is quoted, set the flag. - */ - if (isset(cblockp->c_quote, clistp->c_cf - (char *)cblockp->c_info)) - chr |= QUOTEMASK; - - /* * Advance to next character. */ clistp->c_cf++; @@ -405,19 +394,6 @@ } } - /* - * If this character is quoted, set the quote bit, if not, clear it. - */ - if (chr & QUOTEMASK) { - setbit(cblockp->c_quote, clistp->c_cl - (char *)cblockp->c_info); - /* - * Use one of the spare quote bits to record that something - * may be quoted. - */ - setbit(cblockp->c_quote, CBQSIZE * NBBY - 1); - } else - clrbit(cblockp->c_quote, clistp->c_cl - (char *)cblockp->c_info); - *clistp->c_cl++ = chr; clistp->c_cc++; @@ -497,39 +473,6 @@ bcopy(src, clistp->c_cl, numc); /* - * Clear quote bits if they aren't known to be clear. - * The following could probably be made into a separate - * "bitzero()" routine, but why bother? - */ - if (isset(cblockp->c_quote, CBQSIZE * NBBY - 1)) { - startbit = clistp->c_cl - (char *)cblockp->c_info; - endbit = startbit + numc - 1; - - firstbyte = (u_char *)cblockp->c_quote + (startbit / NBBY); - lastbyte = (u_char *)cblockp->c_quote + (endbit / NBBY); - - /* - * Calculate mask of bits to preserve in first and - * last bytes. - */ - startmask = NBBY - (startbit % NBBY); - startmask = 0xff >> startmask; - endmask = (endbit % NBBY); - endmask = 0xff << (endmask + 1); - - if (firstbyte != lastbyte) { - *firstbyte &= startmask; - *lastbyte &= endmask; - - num_between = lastbyte - firstbyte - 1; - if (num_between) - bzero(firstbyte + 1, num_between); - } else { - *firstbyte &= (startmask | endmask); - } - } - - /* * ...and update pointer for the next chunk. */ src += numc; @@ -582,7 +525,7 @@ * Get the character. Set the quote flag if this character * is quoted. */ - *dst = (u_char)*cp | (isset(cblockp->c_quote, cp - (char *)cblockp->c_info) ? QUOTEMASK : 0); + *dst = (u_char)*cp; return (cp); } @@ -613,12 +556,6 @@ cblockp = (struct cblock *)((intptr_t)clistp->c_cl & ~CROUND); /* - * Set quote flag if this character was quoted. - */ - if (isset(cblockp->c_quote, (u_char *)clistp->c_cl - cblockp->c_info)) - chr |= QUOTEMASK; - - /* * If all of the characters have been unput in this * cblock, then find the previous one and free this * one. ==== //depot/projects/mpsafetty/sys/sys/clist.h#2 (text+ko) ==== @@ -50,7 +50,6 @@ struct cblock { struct cblock *c_next; /* next cblock in queue */ - unsigned char c_quote[CBQSIZE]; /* quoted characters */ unsigned char c_info[CBSIZE]; /* characters */ }; ==== //depot/projects/mpsafetty/sys/sys/param.h#11 (text+ko) ==== @@ -193,9 +193,8 @@ #define NODEV (dev_t)(-1) /* non-existent device */ #define CBLOCK 128 /* Clist block size, must be a power of 2. */ -#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ /* Data chars/clist. */ -#define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) +#define CBSIZE (CBLOCK - sizeof(struct cblock *)) #define CROUND (CBLOCK - 1) /* Clist rounding. */ /*