svn commit: r360851 - head/sys/compat/linuxkpi/common/include/linux

Emmanuel Vadot manu at FreeBSD.org
Sat May 9 17:52:50 UTC 2020


Author: manu
Date: Sat May  9 17:52:50 2020
New Revision: 360851
URL: https://svnweb.freebsd.org/changeset/base/360851

Log:
  linuxkpi: Add bitmap_copy and bitmap_andnot
  
  bitmap_copy simply copy the bitmaps, no idea why it exists.
  bitmap_andnot is similar to bitmap_and but uses !src2.
  
  Sponsored-by: The FreeBSD Foundation
  Reviewed by:	hselasky
  Differential Revision:	https://reviews.freebsd.org/D24782

Modified:
  head/sys/compat/linuxkpi/common/include/linux/bitmap.h

Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/bitmap.h	Sat May  9 17:14:59 2020	(r360850)
+++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h	Sat May  9 17:52:50 2020	(r360851)
@@ -255,6 +255,17 @@ bitmap_complement(unsigned long *dst, const unsigned l
 }
 
 static inline void
+bitmap_copy(unsigned long *dst, const unsigned long *src,
+    const unsigned int size)
+{
+	const unsigned int end = BITS_TO_LONGS(size);
+	unsigned int i;
+
+	for (i = 0; i != end; i++)
+		dst[i] = src[i];
+}
+
+static inline void
 bitmap_or(unsigned long *dst, const unsigned long *src1,
     const unsigned long *src2, const unsigned int size)
 {
@@ -274,6 +285,17 @@ bitmap_and(unsigned long *dst, const unsigned long *sr
 
 	for (i = 0; i != end; i++)
 		dst[i] = src1[i] & src2[i];
+}
+
+static inline void
+bitmap_andnot(unsigned long *dst, const unsigned long *src1,
+    const unsigned long *src2, const unsigned int size)
+{
+	const unsigned int end = BITS_TO_LONGS(size);
+	unsigned int i;
+
+	for (i = 0; i != end; i++)
+		dst[i] = src1[i] & ~src2[i];
 }
 
 static inline void


More information about the svn-src-head mailing list