Date: Sat, 9 May 2020 17:52:50 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360851 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <202005091752.049HqoGH025311@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005091752.049HqoGH025311>