Date: Mon, 23 May 2016 11:41:35 +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: r300490 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201605231141.u4NBfZ8c004144@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon May 23 11:41:35 2016 New Revision: 300490 URL: https://svnweb.freebsd.org/changeset/base/300490 Log: Add support for atomic_long_inc_not_zero() to the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies 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 Mon May 23 10:31:54 2016 (r300489) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 23 11:41:35 2016 (r300490) @@ -46,7 +46,7 @@ #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(lo, hi) (((2UL << ((hi) - (lo))) - 1UL) << (lo)) +#define GENMASK(h, l) (((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l))) #define BITS_PER_BYTE 8 static inline int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605231141.u4NBfZ8c004144>