From owner-freebsd-arch@FreeBSD.ORG Wed Jun 28 19:42:58 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 12E7C16A4A7 for ; Wed, 28 Jun 2006 19:42:58 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44C8344EAD for ; Wed, 28 Jun 2006 19:22:23 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.220]) ([10.251.17.220]) by a50.ironport.com with ESMTP; 28 Jun 2006 12:22:24 -0700 Message-ID: <44A2D6EE.8080902@elischer.org> Date: Wed, 28 Jun 2006 12:22:22 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Andrew R. Reiter" References: <20060628094221.GA50978@comp.chem.msu.su> <75461.1151488426@critter.freebsd.dk> <20060628100824.GA1326@duncan.reilly.home> <20060628174725.GA57252@comp.chem.msu.su> <20060628150227.R75801@fledge.watson.org> In-Reply-To: <20060628150227.R75801@fledge.watson.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Yar Tikhiy , Poul-Henning Kamp , arch@freebsd.org Subject: Re: SET, CLR, ISSET in types.h for _KERNEL builds X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2006 19:42:58 -0000 Andrew R. Reiter wrote: >I apologize for top posting, but I lost the email that I think my >point/question pertains to. > >Part of this seems to be for compatibility / merging from drivers of other >OSes, no? If I am wrong, ignore me :-). If this is the case, would it be >better to create some common other area for things of this nature so that >it suffices to allow builds, but does not infect other areas of our own >code base? > > how about just making a /sys/sys/netbsd_compat.h and /sys/sys/openbsd_compat.h put this sort of thing in there.. >Could be a poor idea, but just throwing it out there for the fsck of it. > >Cheers, >Andrew > >On Wed, 28 Jun 2006, Yar Tikhiy wrote: > >:On Wed, Jun 28, 2006 at 08:08:24PM +1000, Andrew Reilly wrote: >:> On Wed, Jun 28, 2006 at 09:53:46AM +0000, Poul-Henning Kamp wrote: >:> > In message <20060628094221.GA50978@comp.chem.msu.su>, Yar Tikhiy writes: >:> > >On Tue, Jun 27, 2006 at 01:58:17PM -0600, M. Warner Losh wrote: >:> > >:> > >> NetBSD recently added SET, CLR, ISSET to sys/types.h (only if _KERNEL >:> > >> is defined). >:> > >:> > As one of the people who have worked with the original /bin/sh source >:> > code, I have a slight alergic reaction to attempts to paste over >:> > the implementation language with macros like these. >:> > >:> > Setting a bit in 'C' is spelled >:> > variable |= bit; >:> > not >:> > SET(variable, bit); >:> >:> To my eye, if you're going to use "bit" to describe which bit is >:> being operated on, then you should *really* be doing: >:> variable |= (1 << bit) >:> and, obviously, SET(variable, bit) should do that, rather than >:> what has been proposed. >: >:That would require converting our device .h files from defining bit >:masks to defining bit numbers. I don't mind you doing that as long >:as SET is expanded to: >: >: ((variable) |= (1 << (bit))) >: >:-- note the bunch of roughly balanced parentheses ;-) >: >:-- >:Yar >:_______________________________________________ >:freebsd-arch@freebsd.org mailing list >:http://lists.freebsd.org/mailman/listinfo/freebsd-arch >:To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" >: >: > >-- >arr@watson.org >_______________________________________________ >freebsd-arch@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-arch >To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > >