[coreboot-gerrit] Patch set updated for filo: fs: Don't reimplement log2
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Tue May 3 02:35:57 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 3bced897ad2b05b7054db1f2b5e137e24e932255
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 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)
{
More information about the coreboot-gerrit
mailing list