minios: implement ffs, ffsl, ffsll
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.
Signed-off-by Stefano Stabellini <[email protected]>
---
extras/mini-os/include/posix/strings.h +4 -0
@@ -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