summaryrefslogtreecommitdiff
path: root/sys/external/bsd/common/include/linux
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2021-12-19 09:49:47 +0000
committerriastradh <riastradh@NetBSD.org>2021-12-19 09:49:47 +0000
commitf1ddab6d9ecf5b30eeffa1c43e5bc85df4f37ea6 (patch)
treea820c49e411baa535e57adf707e2ba58d1744f1e /sys/external/bsd/common/include/linux
parent68aac0e1c01471b5e9068165feec8b6bb0c776b5 (diff)
provide BITS_PER_TYPE
Author: Maya Rashish <maya@NetBSD.org>
Diffstat (limited to 'sys/external/bsd/common/include/linux')
-rw-r--r--sys/external/bsd/common/include/linux/bitops.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/external/bsd/common/include/linux/bitops.h b/sys/external/bsd/common/include/linux/bitops.h
index ad5b2104297..6a614cc6e62 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.14 2021/12/19 09:44:27 riastradh Exp $ */
+/* $NetBSD: bitops.h,v 1.15 2021/12/19 09:49:47 riastradh Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -106,8 +106,9 @@ sign_extend64(uint64_t x, unsigned n)
#define BITS_TO_LONGS(n) \
roundup2((n), (sizeof(unsigned long) * CHAR_BIT))
-#define BITS_PER_BYTE NBBY
-#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT)
+#define BITS_PER_TYPE(type) (sizeof(type) * NBBY)
+#define BITS_PER_BYTE NBBY
+#define BITS_PER_LONG (__SIZEOF_LONG__ * CHAR_BIT)
#define BIT(n) ((unsigned long)__BIT(n))
#define BIT_ULL(n) ((unsigned long long)__BIT(n))