Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102809106
D39552.id120250.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
916 B
Referenced Files
None
Subscribers
None
D39552.id120250.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/bitmap.h b/sys/compat/linuxkpi/common/include/linux/bitmap.h
--- a/sys/compat/linuxkpi/common/include/linux/bitmap.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitmap.h
@@ -288,6 +288,26 @@
dst[i] = src[i];
}
+static inline void
+bitmap_to_arr32(uint32_t *dst, const unsigned long *src, unsigned int size)
+{
+ const unsigned int end = howmany(size, 32);
+
+#ifdef __LP64__
+ unsigned int i = 0;
+ while (i < end) {
+ dst[i++] = (uint32_t)(*src & UINT_MAX);
+ if (i < end)
+ dst[i++] = (uint32_t)(*src >> 32);
+ src++;
+ }
+#else
+ bitmap_copy(dst, src, size);
+#endif
+ if ((size % 32) != 0) /* Linux uses BITS_PER_LONG. Seems to be a bug */
+ dst[end - 1] &= (uint32_t)(UINT_MAX >> (32 - (size % 32)));
+}
+
static inline void
bitmap_or(unsigned long *dst, const unsigned long *src1,
const unsigned long *src2, const unsigned int size)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 11:31 AM (21 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14696746
Default Alt Text
D39552.id120250.diff (916 B)
Attached To
Mode
D39552: LinuxKPI: Add bitmap_to_arr32() to <linux/bitmap.h>
Attached
Detach File
Event Timeline
Log In to Comment