From owner-freebsd-arch@FreeBSD.ORG Wed Jun 28 12:12:49 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 58AF016A508 for ; Wed, 28 Jun 2006 12:12:49 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp-3.dlr.de (smtp-3.dlr.de [195.37.61.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id F25ED446AE for ; Wed, 28 Jun 2006 11:39:59 +0000 (GMT) (envelope-from Hartmut.Brandt@dlr.de) Received: from beagle.kn.op.dlr.de ([129.247.173.6]) by smtp-3.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Wed, 28 Jun 2006 13:39:57 +0200 Date: Wed, 28 Jun 2006 13:39:58 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Alex Lyashkov In-Reply-To: <1151490061.3525.9.camel@berloga.shadowland> Message-ID: <20060628133928.H52624@beagle.kn.op.dlr.de> References: <20060627.135817.-490997979.imp@bsdimp.com> <1151490061.3525.9.camel@berloga.shadowland> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1442591016-1151494792=:52624" X-OriginalArrivalTime: 28 Jun 2006 11:39:57.0729 (UTC) FILETIME=[9509A110:01C69AA7] Cc: 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 Reply-To: Harti Brandt 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 12:12:49 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1442591016-1151494792=:52624 Content-Type: TEXT/PLAIN; charset=koi8-r Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 28 Jun 2006, Alex Lyashkov wrote: AL>=F7 =F7=D4=D2, 27.06.2006, =D7 22:58, M. Warner Losh =D0=C9=DB=C5=D4: AL>> NetBSD recently added SET, CLR, ISSET to sys/types.h (only if _KERNEL AL>> is defined). I'd like to do something similar in FreeBSD. I see no AL>> reason to needless deviate from NetBSD here. One could make an AL>> argument for lots of different files, but at the end of the day does AL>> it really matter enough to justify having it be different than NetBSD? AL>>=20 AL>> Here's my proposed diff, inline, for your consideration: AL>>=20 AL> AL>>=20 AL>> NOTE: That /* !_KERNEL */ should have the '!' removed, but I didn't AL>> want to confuse things by doing that too. AL>>=20 AL>> Comments? AL>>=20 AL>> Warner AL>> _______________________________________________ AL>Who not create abstract framework for work with bitmask more then 64bits AL>size?=20 AL>similar this: AL> AL>#define_bitmask(name,size)=09char name[(size/8)+1]; AL>#define set_bit(bimask,no)=09{ bitmask[(no/8)] |=3D 1<<(no%8); } AL>#define clr_bit(bitmask,no)=09=09{ bitmask[(no/8)] &=3D ~(1<<(no%8)); } AL>static inline isset_bit(char *bitmask, no) { AL>=09return bitmask[(no/8)] & 1<<(no%8); You mean bitstring(3)? harti --0-1442591016-1151494792=:52624--