From owner-freebsd-arch@FreeBSD.ORG Wed Jun 28 10:21:04 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 DB98016A407 for ; Wed, 28 Jun 2006 10:21:04 +0000 (UTC) (envelope-from shadow@psoft.net) Received: from mail.sevcity.net (ns.sevcity.net [193.47.166.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 541C044634 for ; Wed, 28 Jun 2006 10:21:03 +0000 (GMT) (envelope-from shadow@psoft.net) Received: from mail.sevcity.net (service.sevcity [127.0.0.1]) by mail.sevcity.net (Postfix) with ESMTP id 9FAF217000E; Wed, 28 Jun 2006 13:23:31 +0300 (EEST) Received: from berloga.shadowland (umka.sevcity.net [193.47.166.138]) by mail.sevcity.net (Postfix) with ESMTP id 7BEE9170004; Wed, 28 Jun 2006 13:23:31 +0300 (EEST) Received: from berloga.shadowland (berloga.shadowland [127.0.0.1]) by berloga.shadowland (8.12.11.20060308/8.12.11) with ESMTP id k5SAL2d4003657; Wed, 28 Jun 2006 13:21:02 +0300 Received: (from root@localhost) by berloga.shadowland (8.12.11.20060308/8.12.11/Submit) id k5SAL1IK003655; Wed, 28 Jun 2006 13:21:01 +0300 From: Alex Lyashkov To: "M. Warner Losh" In-Reply-To: <20060627.135817.-490997979.imp@bsdimp.com> References: <20060627.135817.-490997979.imp@bsdimp.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable Organization: Positive Software Message-Id: <1151490061.3525.9.camel@berloga.shadowland> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-17) Date: Wed, 28 Jun 2006 13:21:01 +0300 X-Virus-Scanned: ClamAV using ClamSMTP 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 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 10:21:04 -0000 =F7 =F7=D4=D2, 27.06.2006, =D7 22:58, M. Warner Losh =D0=C9=DB=C5=D4: > NetBSD recently added SET, CLR, ISSET to sys/types.h (only if _KERNEL > is defined). I'd like to do something similar in FreeBSD. I see no > reason to needless deviate from NetBSD here. One could make an > argument for lots of different files, but at the end of the day does > it really matter enough to justify having it be different than NetBSD? >=20 > Here's my proposed diff, inline, for your consideration: >=20 >=20 > NOTE: That /* !_KERNEL */ should have the '!' removed, but I didn't > want to confuse things by doing that too. >=20 > Comments? >=20 > Warner > _______________________________________________ Who not create abstract framework for work with bitmask more then 64bits size?=20 similar this: #define_bitmask(name,size) char name[(size/8)+1]; #define set_bit(bimask,no) { bitmask[(no/8)] |=3D 1<<(no%8); } #define clr_bit(bitmask,no) { bitmask[(no/8)] &=3D ~(1<<(no%8)); } static inline isset_bit(char *bitmask, no) { return bitmask[(no/8)] & 1<<(no%8); } --=20 Alex Lyashkov Positive Software