mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 03:55:46 +03:00
Add fls() for non-constant values.
This commit is contained in:
10
src/core/bitops.c
Normal file
10
src/core/bitops.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <strings.h>
|
||||
|
||||
int __flsl ( long x ) {
|
||||
int r = 0;
|
||||
|
||||
for ( r = 0 ; x ; r++ ) {
|
||||
x >>= 1;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
Reference in New Issue
Block a user