]> Zhao Yanbai Git Server - minix.git/commitdiff
New bit map manipulation header.
authorJorrit Herder <jnherder@minix3.org>
Mon, 20 Jun 2005 14:29:09 +0000 (14:29 +0000)
committerJorrit Herder <jnherder@minix3.org>
Mon, 20 Jun 2005 14:29:09 +0000 (14:29 +0000)
General purpose.

include/minix/bitmap.h [new file with mode: 0644]

diff --git a/include/minix/bitmap.h b/include/minix/bitmap.h
new file mode 100644 (file)
index 0000000..47da128
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _BITMAP_H
+#define _BITMAP_H
+
+/* Bit map operations to manipulate bits of a simple mask variable. */
+#define bit_set(mask, n)       ((mask) |= (1 << (n)))
+#define bit_unset(mask, n)     ((mask) &= ~(1 << (n)))
+#define bit_isset(mask, n)     ((mask) & (1 << (n)))
+#define bit_empty(mask)                ((mask) = 0)
+#define bit_fill(mask)         ((mask) = ~0)
+
+#endif /* _BITMAP_H */