summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2013-05-15 01:20:10 +0200
committerRichard Braun <rbraun@sceen.net>2013-05-15 01:20:10 +0200
commitb71df26177d390a2d474cbd0e399da98e518e2ce (patch)
tree5d4a389c74578bd3a105687e3206a1f68c313e07
parent5e6355ad979f87bb5784d7a8336087c60df83b06 (diff)
kern/bitmap: new bitmap_copy function
-rw-r--r--kern/bitmap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/kern/bitmap.h b/kern/bitmap.h
index 9fc92986..526824d6 100644
--- a/kern/bitmap.h
+++ b/kern/bitmap.h
@@ -93,6 +93,15 @@ bitmap_fill(unsigned long *bm, int nr_bits)
}
static inline void
+bitmap_copy(unsigned long *dest, const unsigned long *src, int nr_bits)
+{
+ int n;
+
+ n = BITMAP_LONGS(nr_bits);
+ memcpy(dest, src, n * sizeof(unsigned long));
+}
+
+static inline void
bitmap_set(unsigned long *bm, int bit)
{
if (bit >= LONG_BIT)