summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2012-11-27 15:38:38 +0000
committerSimon Glass <sjg@chromium.org>2012-11-28 11:40:03 -0800
commit8abebe3eadb35222a1147078da4010b4cbfe5858 (patch)
tree77ae39f4b01c615f0d5fe828eb10638c704f1889 /arch/x86
parentc73c6de60c94b444cd717ffd27041a49fbbc4849 (diff)
downloadu-boot-imx-8abebe3eadb35222a1147078da4010b4cbfe5858.zip
u-boot-imx-8abebe3eadb35222a1147078da4010b4cbfe5858.tar.gz
u-boot-imx-8abebe3eadb35222a1147078da4010b4cbfe5858.tar.bz2
x86: Add ilog2 to bitops
ilog2 is required by AHCI driver Signed-off-by: Graeme Russ <graeme.russ@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/bitops.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index c7a38f2..5a7e4cb 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -351,6 +351,11 @@ static __inline__ int ffs(int x)
}
#define PLATFORM_FFS
+static inline int __ilog2(unsigned int x)
+{
+ return generic_fls(x) - 1;
+}
+
/**
* hweightN - returns the hamming weight of a N-bit word
* @x: the word to weigh