Changeset View
Changeset View
Standalone View
Standalone View
head/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h
Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
/* | /* | ||||
* Find highest one bit set. | * Find highest one bit set. | ||||
* Returns bit number + 1 of highest bit that is set, otherwise returns 0. | * Returns bit number + 1 of highest bit that is set, otherwise returns 0. | ||||
* High order bit is 31 (or 63 in _LP64 kernel). | * High order bit is 31 (or 63 in _LP64 kernel). | ||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
highbit(ulong_t i) | highbit(unsigned long i) | ||||
{ | { | ||||
#if defined(__FreeBSD__) && defined(_KERNEL) && defined(HAVE_INLINE_FLSL) | #if defined(__FreeBSD__) && defined(_KERNEL) && defined(HAVE_INLINE_FLSL) | ||||
return (flsl(i)); | return (flsl(i)); | ||||
#else | #else | ||||
int h = 1; | int h = 1; | ||||
if (i == 0) | if (i == 0) | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |