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,9 @@ #include #include +#if defined(__FreeBSD__) && defined(_KERNEL) +#include +#endif #ifdef __cplusplus extern "C" { @@ -382,6 +385,9 @@ static __inline int highbit(ulong_t i) { +#if defined(__FreeBSD__) && defined(_KERNEL) && defined(HAVE_INLINE_FLSL) + return (flsl(i)); +#else register int h = 1; if (i == 0) @@ -407,6 +413,7 @@ h += 1; } return (h); +#endif } /* @@ -416,6 +423,9 @@ static __inline int highbit64(uint64_t i) { +#if defined(__FreeBSD__) && defined(_KERNEL) && defined(HAVE_INLINE_FLSLL) + return (flsll(i)); +#else int h = 1; if (i == 0) @@ -439,6 +449,7 @@ h += 1; } return (h); +#endif } #ifdef __cplusplus