Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14374
-gerrit
commit a9912562e6c2c2e08f6fad0f079221b79ecb99cf Author: Stefan Reinauer stefan.reinauer@coreboot.org Date: Thu Apr 14 18:04:29 2016 -0700
fs: Don't reimplement log2
libpayload already provides an implementation, that is available for all platforms. Use that one instead of this incomplete version.
Change-Id: Idcfc09ddc008ccb2eeb46081e25c2b7c1c1cce15 Signed-off-by: Stefan Reinauer stefan.reinauer@coreboot.org --- fs/filesys.h | 32 -------------------------------- 1 file changed, 32 deletions(-)
diff --git a/fs/filesys.h b/fs/filesys.h index 168413b..2fe61a4 100644 --- a/fs/filesys.h +++ b/fs/filesys.h @@ -23,38 +23,6 @@ #include <config.h> #include <fs.h>
-#if defined(__i386__) -/* - * ffz = Find First Zero in word. Undefined if no zero exists, - * so code should check against ~0UL first.. - */ -static inline unsigned long ffz (unsigned long word) -{ - __asm__ ("bsfl %1,%0" - : "=r" (word) - : "r" (~word)); - return word; -} -#elif defined(__ppc__) -static inline unsigned long __ilog2(unsigned long x) -{ - unsigned long lz; - asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); - return 31 - lz; -} - -static inline unsigned long ffz(unsigned long x) -{ - if ((x = ~x) == 0) - return 32; - - return __ilog2(x & -x); -} -#endif - -#define log2(n) ffz(~(n)) - - static inline int substring (const char *s1, const char *s2) {