summaryrefslogtreecommitdiffstats
path: root/src/include/strings.h
diff options
context:
space:
mode:
authorMichael Brown2014-04-24 15:49:08 +0200
committerMichael Brown2014-04-24 15:49:08 +0200
commitdce7107fc087092dc95b420504b26261933d5f73 (patch)
tree19f2d2d874fcaede9cfe98a52d362cd1b21e2822 /src/include/strings.h
parent[test] Add self-tests for flsl() (diff)
downloadipxe-dce7107fc087092dc95b420504b26261933d5f73.tar.gz
ipxe-dce7107fc087092dc95b420504b26261933d5f73.tar.xz
ipxe-dce7107fc087092dc95b420504b26261933d5f73.zip
[libc] Add inline assembly implementation of flsl() using BSR instruction
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/strings.h')
-rw-r--r--src/include/strings.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/strings.h b/src/include/strings.h
index c7063d68..924a084f 100644
--- a/src/include/strings.h
+++ b/src/include/strings.h
@@ -5,6 +5,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <limits.h>
#include <string.h>
+#include <bits/strings.h>
static inline __attribute__ (( always_inline )) int
__constant_flsl ( unsigned long x ) {
@@ -42,8 +43,7 @@ __constant_flsl ( unsigned long x ) {
return r;
}
-/* We don't actually have these functions yet */
-extern int __flsl ( long x );
+int __flsl ( long x );
#define flsl( x ) \
( __builtin_constant_p ( x ) ? __constant_flsl ( x ) : __flsl ( x ) )