Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2018 18:08:21 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330388 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201803041808.w24I8LTI082719@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803041808.w24I8LTI082719>