From owner-freebsd-arch@FreeBSD.ORG Wed Jun 28 18:19:47 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 26A0316A539 for ; Wed, 28 Jun 2006 18:19:47 +0000 (UTC) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50A7F45432 for ; Wed, 28 Jun 2006 17:47:33 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.4/8.13.3) with ESMTP id k5SHlQvM057391; Wed, 28 Jun 2006 21:47:26 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.4/8.13.3/Submit) id k5SHlPGS057390; Wed, 28 Jun 2006 21:47:25 +0400 (MSD) (envelope-from yar) Date: Wed, 28 Jun 2006 21:47:25 +0400 From: Yar Tikhiy To: Andrew Reilly Message-ID: <20060628174725.GA57252@comp.chem.msu.su> References: <20060628094221.GA50978@comp.chem.msu.su> <75461.1151488426@critter.freebsd.dk> <20060628100824.GA1326@duncan.reilly.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060628100824.GA1326@duncan.reilly.home> User-Agent: Mutt/1.5.9i Cc: arch@freebsd.org, Poul-Henning Kamp 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 18:19:47 -0000 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