From owner-cvs-all@FreeBSD.ORG Tue Mar 28 18:27:56 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55CFC16A549; Tue, 28 Mar 2006 18:27:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9197343F3E; Tue, 28 Mar 2006 17:59:25 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k2SHxJGY071282; Tue, 28 Mar 2006 12:59:19 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=" Date: Tue, 28 Mar 2006 13:00:06 -0500 User-Agent: KMail/1.9.1 References: <200603281434.k2SEYmaR031447@repoman.freebsd.org> <200603281032.10624.jhb@freebsd.org> <86y7yuwn01.fsf@xps.des.no> In-Reply-To: <86y7yuwn01.fsf@xps.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200603281300.09419.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1359/Tue Mar 28 06:49:08 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/include atomic.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2006 18:27:57 -0000 On Tuesday 28 March 2006 11:30, Dag-Erling Sm=F8rgrav wrote: > John Baldwin writes: > > On Tuesday 28 March 2006 09:34, Dag-Erling Smorgrav wrote: > > > Log: > > > Use wrapper macros for atomic pointer operations in order to perfor= m the > > > correct casts. This should probably be merged to other architectur= es. > > It should really be uintptr_t rather than u_int. >=20 > I realize that, but I wasn't sure I could safely assume that uintptr_t > is defined - and by definition, at this point in the code, we know > that u_int is compatible with a pointer. Hmm, I think you can assume that because sparc64's atomic.h uses uintptr_t. I'd prefer it as it would reduce diff's with other archs as well (I tend to do diff's between files in sys/i386 and sys/amd64). One reason for not having the casts, btw, is that you lose type checking. Requiring the caller to add the casts in places that aren't operating on uintptr_t's (note that the mutex and rwlock code both do operate on uintptr_t's) should force them to have to think (somewhat) and make sure they are really operating on a pointer and not an int, etc. Maybe that level of typechecking isn't needed and perhaps I'm being overly paranoid due to all the (older) code that assumes sizeof(int) =3D=3D sizeof(ptr). =2D-=20 John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org