Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133479389
D33162.id99344.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
580 B
Referenced Files
None
Subscribers
None
D33162.id99344.diff
View Options
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -226,6 +226,22 @@
return (strrchr(p, ch));
}
+static __inline int64_t
+signed_extend64(uint64_t bitmap, int lsb, int width)
+{
+
+ return ((int64_t)(bitmap << (63 - lsb - (width - 1)))) >>
+ (63 - (width - 1));
+}
+
+static __inline int32_t
+signed_extend32(uint32_t bitmap, int lsb, int width)
+{
+
+ return ((int32_t)(bitmap << (31 - lsb - (width - 1)))) >>
+ (31 - (width - 1));
+}
+
/* fnmatch() return values. */
#define FNM_NOMATCH 1 /* Match failed. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 27, 2:35 AM (15 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24265340
Default Alt Text
D33162.id99344.diff (580 B)
Attached To
Mode
D33162: sys/libkern.h: Add type conversion helpers
Attached
Detach File
Event Timeline
Log In to Comment