aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-06-25 08:47:31 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-06 19:30:48 +1000
commit0a0200d7ccd07e34390806c5939c6b87f30edb9a (patch)
treed98a682adb09c5e7e3d5f568334d749715b1211c /libc
parente90acf0f3b406c922d78ebf37fe83e98910d6026 (diff)
downloadskiboot-0a0200d7ccd07e34390806c5939c6b87f30edb9a.zip
skiboot-0a0200d7ccd07e34390806c5939c6b87f30edb9a.tar.gz
skiboot-0a0200d7ccd07e34390806c5939c6b87f30edb9a.tar.bz2
Add "ffs" inline function
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/include/string.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/include/string.h b/libc/include/string.h
index 96b26fa..890ffc2 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -35,4 +35,9 @@ void *memcpy(void *dest, const void *src, size_t n);
void *memmove(void *dest, const void *src, size_t n);
int memcmp(const void *s1, const void *s2, size_t n);
+static inline int ffs(unsigned long val)
+{
+ return __builtin_ffs(val);
+}
+
#endif