summaryrefslogtreecommitdiff
path: root/sys/external/bsd/common/include/linux
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2021-12-19 01:04:12 +0000
committerriastradh <riastradh@NetBSD.org>2021-12-19 01:04:12 +0000
commiteecca049403cd96b8bcbe08e20d0e33f6b4cf16d (patch)
treef8a7d7ed79af85bc0a0158b9e7c50136adc13c7b /sys/external/bsd/common/include/linux
parent75a8145b64b2c178537fbeaf609d65fc8674ce8c (diff)
Add BITS_PER_BYTE and BIT_ULL. Fix type of BIT.
Diffstat (limited to 'sys/external/bsd/common/include/linux')
-rw-r--r--sys/external/bsd/common/include/linux/bitops.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/external/bsd/common/include/linux/bitops.h b/sys/external/bsd/common/include/linux/bitops.h
index e4ee1a2a0d5..d1d6e1d4a7c 100644
--- a/sys/external/bsd/common/include/linux/bitops.h
+++ b/sys/external/bsd/common/include/linux/bitops.h
@@ -1,4 +1,4 @@
-/* $NetBSD: bitops.h,v 1.9 2019/12/05 20:03:09 maya Exp $ */
+/* $NetBSD: bitops.h,v 1.10 2021/12/19 01:04:12 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -106,7 +106,10 @@ hweight64(uint64_t n)
#define BITS_TO_LONGS(n) \
roundup2((n), (sizeof(unsigned long) * CHAR_BIT))
-#define BIT(n) ((uintmax_t)1 << (n))
+#define BITS_PER_BYTE NBBY
+
+#define BIT(n) ((unsigned long)__BIT(n))
+#define BIT_ULL(n) ((unsigned long long)__BIT(n))
#define GENMASK(h,l) __BITS(h,l)
static inline int