summaryrefslogtreecommitdiff
path: root/include/linux/bitops.h
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2017-11-28 16:54:09 -0500
committerTom Rini <[email protected]>2017-11-28 16:54:09 -0500
commit74a4818415852560b43ee990ce47c68582bef4ca (patch)
treefeedbc26cb649c64301d810fd163ce7af0e77d7c /include/linux/bitops.h
parent65972a0b6204aa298b70b7ebd755bb1ce1ed53ee (diff)
parenta27bcbf81563880a1cfc805625dc57dbde658e1d (diff)
Merge git://git.denx.de/u-boot-uniphier
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r--include/linux/bitops.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 576b15dc53c..a47f6d17bb5 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -5,9 +5,16 @@
#include <asm-generic/bitsperlong.h>
#include <linux/compiler.h>
+#ifdef __KERNEL__
#define BIT(nr) (1UL << (nr))
+#define BIT_ULL(nr) (1ULL << (nr))
#define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
+#define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG))
+#define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG)
+#define BITS_PER_BYTE 8
+#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
+#endif
/*
* Create a contiguous bitmask starting at bit position @l and ending at