summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bitops.h8
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/posix/bitops.h5
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bitops.h b/drivers/gpu/nvgpu/include/nvgpu/bitops.h
index 26b6e19d..8760708e 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/bitops.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/bitops.h
@@ -22,6 +22,14 @@
22#ifndef __NVGPU_BITOPS_H__ 22#ifndef __NVGPU_BITOPS_H__
23#define __NVGPU_BITOPS_H__ 23#define __NVGPU_BITOPS_H__
24 24
25#include <nvgpu/types.h>
26
27/*
28 * Explicit sizes for bit definitions. Please use these instead of BIT().
29 */
30#define BIT32(i) (U32(1) << (i))
31#define BIT64(i) (U64(1) << (i))
32
25#ifdef __KERNEL__ 33#ifdef __KERNEL__
26#include <linux/bitops.h> 34#include <linux/bitops.h>
27#include <linux/bitmap.h> 35#include <linux/bitmap.h>
diff --git a/drivers/gpu/nvgpu/include/nvgpu/posix/bitops.h b/drivers/gpu/nvgpu/include/nvgpu/posix/bitops.h
index 94618d14..e8c663b0 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/posix/bitops.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/posix/bitops.h
@@ -33,7 +33,10 @@
33#define BITS_TO_LONGS(bits) \ 33#define BITS_TO_LONGS(bits) \
34 (bits + (BITS_PER_LONG - 1) / BITS_PER_LONG) 34 (bits + (BITS_PER_LONG - 1) / BITS_PER_LONG)
35 35
36#define BIT(i) (1ULL << (i)) 36/*
37 * Deprecated; use the explicit BITxx() macros instead.
38 */
39#define BIT(i) BIT64(i)
37 40
38#define GENMASK(h, l) \ 41#define GENMASK(h, l) \
39 (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h)))) 42 (((~0UL) - (1UL << (l)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (h))))