diff options
author | Richard Braun <rbraun@sceen.net> | 2013-05-15 01:20:10 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2013-05-15 01:20:10 +0200 |
commit | b71df26177d390a2d474cbd0e399da98e518e2ce (patch) | |
tree | 5d4a389c74578bd3a105687e3206a1f68c313e07 | |
parent | 5e6355ad979f87bb5784d7a8336087c60df83b06 (diff) |
kern/bitmap: new bitmap_copy function
-rw-r--r-- | kern/bitmap.h | 9 |
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) |