From ce03b3013f9dc19eaa6096d33bc55bd89395c341 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sun, 10 May 2020 13:07:00 +0000 Subject: [PATCH] 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 --- sys/compat/linuxkpi/common/include/linux/bitmap.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/bitmap.h b/sys/compat/linuxkpi/common/include/linux/bitmap.h index 08dd69bce18..0b8ab473b1c 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 +#include 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_ */