summaryrefslogtreecommitdiffstats
path: root/sys/sys/bitset.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/bitset.h')
-rw-r--r--sys/sys/bitset.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h
index e6c4dc3..d130522 100644
--- a/sys/sys/bitset.h
+++ b/sys/sys/bitset.h
@@ -176,4 +176,14 @@
__bit; \
})
+#define BIT_COUNT(_s, p) __extension__ ({ \
+ __size_t __i; \
+ int __count; \
+ \
+ __count = 0; \
+ for (__i = 0; __i < __bitset_words((_s)); __i++) \
+ __count += __bitcountl((p)->__bits[__i]); \
+ __count; \
+})
+
#endif /* !_SYS_BITSET_H_ */
OpenPOWER on IntegriCloud