Re: SET, CLR, ISSET in types.h for _KERNEL builds
- From: Harti Brandt <hartmut.brandt@xxxxxx>
- Date: Wed, 28 Jun 2006 13:39:58 +0200 (CEST)
On Wed, 28 Jun 2006, Alex Lyashkov wrote:
AL>В Втр, 27.06.2006, в 22:58, M. Warner Losh пишет:
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>>
AL>> Here's my proposed diff, inline, for your consideration:
AL>>
AL>
AL>>
AL>> NOTE: That /* !_KERNEL */ should have the '!' removed, but I didn't
AL>> want to confuse things by doing that too.
AL>>
AL>> Comments?
AL>>
AL>> Warner
AL>> _______________________________________________
AL>Who not create abstract framework for work with bitmask more then 64bits
AL>size?
AL>similar this:
AL>
AL>#define_bitmask(name,size) char name[(size/8)+1];
AL>#define set_bit(bimask,no) { bitmask[(no/8)] |= 1<<(no%8); }
AL>#define clr_bit(bitmask,no) { bitmask[(no/8)] &= ~(1<<(no%8)); }
AL>static inline isset_bit(char *bitmask, no) {
AL> return bitmask[(no/8)] & 1<<(no%8);
You mean bitstring(3)?
harti_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: SET, CLR, ISSET in types.h for _KERNEL builds
- From: Alex Lyashkov
- Re: SET, CLR, ISSET in types.h for _KERNEL builds
- References:
- SET, CLR, ISSET in types.h for _KERNEL builds
- From: M. Warner Losh
- Re: SET, CLR, ISSET in types.h for _KERNEL builds
- From: Alex Lyashkov
- SET, CLR, ISSET in types.h for _KERNEL builds
- Prev by Date: Re: SET, CLR, ISSET in types.h for _KERNEL builds
- Next by Date: Re: SET, CLR, ISSET in types.h for _KERNEL builds
- Previous by thread: Re: SET, CLR, ISSET in types.h for _KERNEL builds
- Next by thread: Re: SET, CLR, ISSET in types.h for _KERNEL builds
- Index(es):
Relevant Pages
|