summaryrefslogtreecommitdiffstats
path: root/src/core/bitops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/bitops.c')
-rw-r--r--src/core/bitops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/bitops.c b/src/core/bitops.c
new file mode 100644
index 000000000..75d57bf99
--- /dev/null
+++ b/src/core/bitops.c
@@ -0,0 +1,10 @@
+#include <strings.h>
+
+int __flsl ( long x ) {
+ int r = 0;
+
+ for ( r = 0 ; x ; r++ ) {
+ x >>= 1;
+ }
+ return r;
+}