diff options
author | hselasky <hselasky@FreeBSD.org> | 2018-03-13 16:22:32 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2018-03-13 16:22:32 +0000 |
commit | 224e13a15a548ad333a0bea9a6c0b309743cf5ef (patch) | |
tree | e27acb55a5dafce2740e121f6bbdcaf68a2f7ffa | |
parent | 00ad94ee49577e7241a483de70b0958e544847d4 (diff) | |
download | FreeBSD-src-224e13a15a548ad333a0bea9a6c0b309743cf5ef.zip FreeBSD-src-224e13a15a548ad333a0bea9a6c0b309743cf5ef.tar.gz |
MFC r330388:
Implement GENMASK_ULL() function macro in the LinuxKPI.
Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/bitops.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index e3af17d..b6355a1 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -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)) |