summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/param.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/include/sys/param.h b/sys/include/sys/param.h
index 7631057..91566ae 100644
--- a/sys/include/sys/param.h
+++ b/sys/include/sys/param.h
@@ -38,6 +38,11 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+/* Bitmap helper macros */
+#define setbit(a, b) ((a)[(b) >> 3] |= BIT(b % 8))
+#define clrbit(a, b) ((a)[(b) >> 3] &= ~BIT(b % 8))
+#define testbit(a, b) (ISSET((a)[(b) >> 3], BIT(b % 8)))
+
#define NELEM(a) (sizeof(a) / sizeof(a[0]))
#endif /* _SYS_PARAM_H_ */