FreeBSD/sbin/hastd/activemap.c
/*
 * Helper function taken from sys/systm.h to calculate extentshift.
 */
Helper function taken from sys/systm.h to calculate extentshift.
Helper function taken from sys / systm . h to calculate extentshift .
static uint32_t
bitcount32(uint32_t x)
{
	x = (x & 0x55555555) + ((x & 0xaaaaaaaa) >> 1);
	x = (x & 0x33333333) + ((x & 0xcccccccc) >> 2);
	x = (x + (x >> 4)) & 0x0f0f0f0f;
	x = (x + (x >> 8));
	x = (x + (x >> 16)) & 0x000000ff;
	return (x);
}
static uint32_t bitcount32 ( uint32_t x ) { x = ( x & 0x55555555 ) + ( ( x & 0xaaaaaaaa ) >> 1 ) ; x = ( x & 0x33333333 ) + ( ( x & 0xcccccccc ) >> 2 ) ; x = ( x + ( x >> 4 ) ) & 0x0f0f0f0f ; x = ( x + ( x >> 8 ) ) ; x = ( x + ( x >> 16 ) ) & 0x000000ff ; return ( x ) ; }
Helper function taken from sys/systm.h to calculate extentshift.
Helper function taken from sys / systm . h to calculate extentshift .