summaryrefslogtreecommitdiff
path: root/include/asm-ppc
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@netinsight.net>2009-08-24 07:10:12 (GMT)
committerWolfgang Denk <wd@denx.de>2009-09-15 20:34:32 (GMT)
commit52d61227b66d4099b39c8309ab37cb67ee09a405 (patch)
tree0c5562920f48672d38baf05dd744118a4a8f2e69 /include/asm-ppc
parent4b15de08fe4d2c9d12a3764394731018a763216b (diff)
downloadu-boot-fsl-qoriq-52d61227b66d4099b39c8309ab37cb67ee09a405.tar.xz
Define ffs/fls for all architectures
UBIFS requires fls(), which is not defined for arm (and some other architectures) and this patch adds it. The implementation is taken from Linux and is generic. ffs() is also defined for those that miss it. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Diffstat (limited to 'include/asm-ppc')
-rw-r--r--include/asm-ppc/bitops.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h
index daa66cf..9ed2f5d 100644
--- a/include/asm-ppc/bitops.h
+++ b/include/asm-ppc/bitops.h
@@ -178,6 +178,7 @@ static __inline__ int fls(unsigned int x)
{
return __ilog2(x) + 1;
}
+#define fls
/**
* fls64 - find last set bit in a 64-bit word
@@ -230,6 +231,7 @@ extern __inline__ int ffs(int x)
{
return __ilog2(x & -x) + 1;
}
+#define ffs
/*
* hweightN: returns the hamming weight (i.e. the number