Skip to content
Snippets Groups Projects
Commit 8abebe3e authored by Graeme Russ's avatar Graeme Russ Committed by Simon Glass
Browse files

x86: Add ilog2 to bitops


ilog2 is required by AHCI driver

Signed-off-by: default avatarGraeme Russ <graeme.russ@gmail.com>
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent c73c6de6
Branches
Tags
No related merge requests found
...@@ -351,6 +351,11 @@ static __inline__ int ffs(int x) ...@@ -351,6 +351,11 @@ static __inline__ int ffs(int x)
} }
#define PLATFORM_FFS #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 * hweightN - returns the hamming weight of a N-bit word
* @x: the word to weigh * @x: the word to weigh
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment