Re: SET, CLR, ISSET in types.h for _KERNEL builds



В Втр, 27.06.2006, в 22:58, M. Warner Losh пишет:
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?

Here's my proposed diff, inline, for your consideration:



NOTE: That /* !_KERNEL */ should have the '!' removed, but I didn't
want to confuse things by doing that too.

Comments?

Warner
_______________________________________________
Who not create abstract framework for work with bitmask more then 64bits
size?
similar this:

#define_bitmask(name,size) char name[(size/8)+1];
#define set_bit(bimask,no) { bitmask[(no/8)] |= 1<<(no%8); }
#define clr_bit(bitmask,no) { bitmask[(no/8)] &= ~(1<<(no%8)); }
static inline isset_bit(char *bitmask, no) {
return bitmask[(no/8)] & 1<<(no%8);
}
--
Alex Lyashkov <shadow@xxxxxxxxx>
Positive Software
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: SET, CLR, ISSET in types.h for _KERNEL builds
    ... :> it really matter enough to justify having it be different than NetBSD? ... Who not create abstract framework for work with bitmask more then 64bits ... static inline isset_bit ...
    (freebsd-arch)
  • Re: SET, CLR, ISSET in types.h for _KERNEL builds
    ... AL>> reason to needless deviate from NetBSD here. ... AL>> it really matter enough to justify having it be different than NetBSD? ... AL>> Here's my proposed diff, inline, for your consideration: ... AL>Who not create abstract framework for work with bitmask more then 64bits ...
    (freebsd-arch)
  • Re: SET, CLR, ISSET in types.h for _KERNEL builds
    ... AL>> reason to needless deviate from NetBSD here. ... AL>> it really matter enough to justify having it be different than NetBSD? ... AL>> Here's my proposed diff, inline, for your consideration: ... AL>Who not create abstract framework for work with bitmask more then 64bits ...
    (freebsd-arch)
  • Re: SET, CLR, ISSET in types.h for _KERNEL builds
    ... reason to needless deviate from NetBSD here. ... it really matter enough to justify having it be different than NetBSD? ... Here's my proposed diff, inline, for your consideration: ...
    (freebsd-arch)