aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/core/bitops.c
blob: 53abaaeac1416eb573f91cf251b1f85d5d79c7a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <strings.h>

int __flsl ( long x ) {
	unsigned long value = x;
	int ls = 0;

	for ( ls = 0 ; value ; ls++ ) {
		value >>= 1;
	}
	return ls;
}