Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176894136
D2839.1793585761.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
926 B
Referenced Files
None
Subscribers
None
D2839.1793585761.diff
View Options
Index: head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
===================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
@@ -32,6 +32,13 @@
#include <sys/param.h>
#include <sys/isa_defs.h>
+#ifdef __FreeBSD__
+#ifdef _KERNEL
+#include <machine/cpufunc.h>
+#else
+#include <strings.h>
+#endif
+#endif
#ifdef __cplusplus
extern "C" {
@@ -382,6 +389,9 @@
static __inline int
highbit(ulong_t i)
{
+#ifdef __FreeBSD__
+ return (flsl(i));
+#else
register int h = 1;
if (i == 0)
@@ -407,6 +417,7 @@
h += 1;
}
return (h);
+#endif
}
/*
@@ -416,6 +427,9 @@
static __inline int
highbit64(uint64_t i)
{
+#ifdef __FreeBSD__
+ return (flsll(i));
+#else
int h = 1;
if (i == 0)
@@ -439,6 +453,7 @@
h += 1;
}
return (h);
+#endif
}
#ifdef __cplusplus
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 2, 2:16 AM (10 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41301030
Default Alt Text
D2839.1793585761.diff (926 B)
Attached To
Mode
D2839: illums compat: use flsl/flsll for highbit/highbit64
Attached
Detach File
Event Timeline