[coreboot-gerrit] Patch set updated for filo: fs: Don't reimplement log2

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed May 4 21:49:36 CEST 2016


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14374

-gerrit

commit 5f9ab2f60d63723fc5e69d104c78feb1b20d32e5
Author: Stefan Reinauer <stefan.reinauer at 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 at coreboot.org>
---
 fs/filesys.h | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/fs/filesys.h b/fs/filesys.h
index b8cffbc..c882070 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)
 {



More information about the coreboot-gerrit mailing list