Skip to contentSkip to conversation

minios: implement ffs, ffsl, ffsll

PATCH New Stefano Stabellini 1 participant 1 message May 27, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios: implement ffs, ffsl, ffsll

Hi all,
this patch implements ffs, ffsl and ffsll.
The first function is compiled only in case minios is compiled without newlib, since newlib already provides an implementation for ffs. On the other hand ffsl and ffsll are always compiled because newlib misses those functions.
This patch also provides an implementation for __ffsti2 and __ffsdi2 because they are needed by gcc in order to successfully link ffsll.

---

extras/mini-os/include/posix/strings.h +4 -0
diff -r f0e2df69a8eb extras/mini-os/include/posix/strings.h
@@ -5,4 +5,8 @@
 
 #define bzero(ptr, size) (memset((ptr), '\0', (size)), (void) 0)
 
+int ffs (int i);
+int ffsl (long int li);
+int ffsll (long long int lli);
+
 #endif /* _POSIX_STRINGS_H */
extras/mini-os/lib/string.c +50 -0

60 lines not on this page · raw message