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



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:

Index: types.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/types.h,v
retrieving revision 1.95
diff -u -r1.95 types.h
--- types.h 26 Nov 2005 12:42:35 -0000 1.95
+++ types.h 27 Jun 2006 19:57:23 -0000
@@ -294,6 +294,11 @@

#define offsetof(type, field) __offsetof(type, field)

+/* Macros to clear/set/test flags. */
+#define SET(t, f) (t) |= (f)
+#define CLR(t, f) (t) &= ~(f)
+#define ISSET(t, f) ((t) & (f))
+
#endif /* !_KERNEL */

/*

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

Comments?

Warner
_______________________________________________
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
    ... 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)
  • Re: SET, CLR, ISSET in types.h for _KERNEL builds
    ... it really matter enough to justify having it be different than NetBSD? ... Here's my proposed diff, inline, for your consideration: ... I'd rather enclose the whole RHS of SET and CLR in parentheses. ...
    (freebsd-arch)
  • The case for FreeBSD
    ... There has been a lot of recent talk and advocacy for NetBSD 2.0 from the ... their claims and much of their criticisms of FreeBSD. ... network stack in a transparent and quick fashion. ... support available in an open source operating system. ...
    (freebsd-current)
  • Re: The case for FreeBSD
    ... And what about linux 2.6 vs FreeBSD? ... > There has been a lot of recent talk and advocacy for NetBSD 2.0 from the ... A team of FreeBSD developers works closely ... > support available in an open source operating system. ...
    (freebsd-current)
  • Re: The case for FreeBSD
    ... As the old saying goes, FreeBSD is about performance, NetBSD ... and OpenBSD is about security. ... Yes, the issue of advocacy. ...
    (freebsd-current)