summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/gpxe/src/core/bitops.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/syslinux-4.02/gpxe/src/core/bitops.c')
-rw-r--r--contrib/syslinux-4.02/gpxe/src/core/bitops.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/gpxe/src/core/bitops.c b/contrib/syslinux-4.02/gpxe/src/core/bitops.c
new file mode 100644
index 0000000..1bca9e4
--- /dev/null
+++ b/contrib/syslinux-4.02/gpxe/src/core/bitops.c
@@ -0,0 +1,13 @@
+#include <strings.h>
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+int __flsl ( long x ) {
+ unsigned long value = x;
+ int ls = 0;
+
+ for ( ls = 0 ; value ; ls++ ) {
+ value >>= 1;
+ }
+ return ls;
+}