aboutsummaryrefslogtreecommitdiffstats
path: root/linux-headers/linux/bits.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-04-23 11:46:47 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-04-23 17:35:25 +0200
commitab0c7fb22b56523f24d6e127cd4d10ecff67bf85 (patch)
tree2b54fcbdc5b5b5457cbd764b29ad924d34437992 /linux-headers/linux/bits.h
parentscripts/update-linux-headers: Add bits.h to file imports (diff)
downloadqemu-ab0c7fb22b56523f24d6e127cd4d10ecff67bf85.tar.xz
qemu-ab0c7fb22b56523f24d6e127cd4d10ecff67bf85.zip
linux-headers: update to current kvm/next
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'linux-headers/linux/bits.h')
-rw-r--r--linux-headers/linux/bits.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/linux-headers/linux/bits.h b/linux-headers/linux/bits.h
new file mode 100644
index 0000000000..d9897771be
--- /dev/null
+++ b/linux-headers/linux/bits.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/* bits.h: Macros for dealing with bitmasks. */
+
+#ifndef _LINUX_BITS_H
+#define _LINUX_BITS_H
+
+#define __GENMASK(h, l) \
+ (((~_UL(0)) - (_UL(1) << (l)) + 1) & \
+ (~_UL(0) >> (__BITS_PER_LONG - 1 - (h))))
+
+#define __GENMASK_ULL(h, l) \
+ (((~_ULL(0)) - (_ULL(1) << (l)) + 1) & \
+ (~_ULL(0) >> (__BITS_PER_LONG_LONG - 1 - (h))))
+
+#endif /* _LINUX_BITS_H */