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

Hans Petter Selasky hselasky at FreeBSD.org
Sun Mar 4 18:08:22 UTC 2018


Author: hselasky
Date: Sun Mar  4 18:08:21 2018
New Revision: 330388
URL: https://svnweb.freebsd.org/changeset/base/330388

Log:
  Implement GENMASK_ULL() function macro in the LinuxKPI.
  
  MFC after:	1 week
  Submitted by:	Johannes Lundberg <johalun0 at gmail.com>
  Sponsored by:	Mellanox Technologies
  Sponsored by:	Limelight Networks

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

Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h	Sun Mar  4 18:04:37 2018	(r330387)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h	Sun Mar  4 18:08:21 2018	(r330388)
@@ -45,12 +45,15 @@
 #define	BITS_PER_LONG		32
 #endif
 
+#define	BITS_PER_LONG_LONG	64
+
 #define	BITMAP_FIRST_WORD_MASK(start)	(~0UL << ((start) % BITS_PER_LONG))
 #define	BITMAP_LAST_WORD_MASK(n)	(~0UL >> (BITS_PER_LONG - (n)))
 #define	BITS_TO_LONGS(n)	howmany((n), BITS_PER_LONG)
 #define	BIT_MASK(nr)		(1UL << ((nr) & (BITS_PER_LONG - 1)))
 #define BIT_WORD(nr)		((nr) / BITS_PER_LONG)
 #define	GENMASK(h, l)		(((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l)))
+#define	GENMASK_ULL(h, l)	(((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l)))
 #define BITS_PER_BYTE           8
 
 #define	hweight8(x)	bitcount((uint8_t)(x))


More information about the svn-src-head mailing list