mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user