diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2013-10-11 16:54:59 -0700 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-17 00:36:07 +0200 |
commit | bfd1ff6375c82930bfb3b401eee2c96720fa8e84 (patch) | |
tree | e5016ca784cdefd6fbd68431eb9d23838157965e | |
parent | 1a6b991a9875a4c4811c7baf4058fa17aa1a9d9b (diff) | |
download | blackbird-op-linux-bfd1ff6375c82930bfb3b401eee2c96720fa8e84.tar.gz blackbird-op-linux-bfd1ff6375c82930bfb3b401eee2c96720fa8e84.zip |
bitops: Introduce BIT_ULL
Adding BIT(x) equivalent for unsigned long long type, BIT_ULL(x). Also
added BIT_ULL_MASK and BIT_ULL_WORD.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | include/linux/bitops.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a3b6b82108b9..5a1c8b71ccd8 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -4,8 +4,11 @@ #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 |