Page MenuHomeFreeBSD

D56584.id176167.diff
No OneTemporary

D56584.id176167.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h
--- a/sys/compat/linuxkpi/common/include/linux/bitops.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitops.h
@@ -35,6 +35,8 @@
#include <sys/errno.h>
#include <sys/libkern.h>
+#include <linux/bits.h>
+
#define BIT(nr) (1UL << (nr))
#define BIT_ULL(nr) (1ULL << (nr))
#define BITS_PER_LONG (__SIZEOF_LONG__ * __CHAR_BIT__)
@@ -45,8 +47,6 @@
#define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG)
#define BIT_MASK(nr) (1UL << ((nr) & (BITS_PER_LONG - 1)))
#define BIT_WORD(nr) ((nr) / BITS_PER_LONG)
-#define GENMASK(h, l) (((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l)))
-#define GENMASK_ULL(h, l) (((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l)))
#define BITS_PER_BYTE 8
#define BITS_PER_TYPE(t) (sizeof(t) * BITS_PER_BYTE)
#define BITS_TO_BYTES(n) howmany((n), BITS_PER_BYTE)
diff --git a/sys/compat/linuxkpi/common/include/linux/bits.h b/sys/compat/linuxkpi/common/include/linux/bits.h
new file mode 100644
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/bits.h
@@ -0,0 +1,14 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2016 Kip Macy
+ * Copyright (c) 2018 Johannes Lundberg
+ */
+
+#ifndef _LINUXKPI_LINUX_BITS_H_
+#define _LINUXKPI_LINUX_BITS_H_
+
+#define GENMASK(h, l) (((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l)))
+#define GENMASK_ULL(h, l) (((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l)))
+
+#endif /* _LINUXKPI_LINUX_BITS_H_ */

File Metadata

Mime Type
text/plain
Expires
Mon, Jul 6, 7:28 AM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34744226
Default Alt Text
D56584.id176167.diff (1 KB)

Event Timeline