aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/bitmap.h
diff options
context:
space:
mode:
authorEmmanuel Vadot <manu@FreeBSD.org>2020-05-10 13:07:00 +0000
committerEmmanuel Vadot <manu@FreeBSD.org>2020-05-10 13:07:00 +0000
commitce03b3013f9dc19eaa6096d33bc55bd89395c341 (patch)
tree43944d94b120e9d5b77f6d56c5b8952b87d26f2b /sys/compat/linuxkpi/common/include/linux/bitmap.h
parent8123bbf1861616a0728a4ddbfa06ab966b0fdbf2 (diff)
downloadsrc-ce03b3013f9dc19eaa6096d33bc55bd89395c341.tar.gz
src-ce03b3013f9dc19eaa6096d33bc55bd89395c341.zip
linuxkpi: Add bitmap_alloc and bitmap_free
This is a simple call to kmallock_array/kfree, therefore include linux/slab.h as this is where the kmalloc_array/kfree definition is. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision: https://reviews.freebsd.org/D24794
Notes
Notes: svn path=/head/; revision=360870
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/bitmap.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/bitmap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/bitmap.h b/sys/compat/linuxkpi/common/include/linux/bitmap.h
index 08dd69bce180..0b8ab473b1cd 100644
--- a/sys/compat/linuxkpi/common/include/linux/bitmap.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitmap.h
@@ -30,6 +30,7 @@
#define _LINUX_BITMAP_H_
#include <linux/bitops.h>
+#include <linux/slab.h>
static inline void
bitmap_zero(unsigned long *addr, const unsigned int size)
@@ -309,4 +310,10 @@ bitmap_xor(unsigned long *dst, const unsigned long *src1,
dst[i] = src1[i] ^ src2[i];
}
+static inline void
+bitmap_free(const unsigned long *bitmap)
+{
+ kfree(bitmap);
+}
+
#endif /* _LINUX_BITMAP_H_ */