mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
Correct ffs/fls regression for PowerPC etc
Commits02f99901ed
52d61227b6
introduced a regression where platform-specific ffs/fls implementations were defined away. This patch corrects that by using PLATFORM_xxx instead of the name itself. Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
15fba3279b
commit
0413cfecea
11 changed files with 15 additions and 41 deletions
|
@ -124,14 +124,6 @@ static inline unsigned long ffz(unsigned long word)
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ffs: find first bit set. This is defined the same way as
|
|
||||||
* the libc and compiler builtin ffs routines, therefore
|
|
||||||
* differs in spirit from the above ffz (man ffs).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define ffs(x) generic_ffs(x)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* hweightN: returns the hamming weight (i.e. the number
|
* hweightN: returns the hamming weight (i.e. the number
|
||||||
* of bits set) of a N-bit word
|
* of bits set) of a N-bit word
|
||||||
|
|
|
@ -79,7 +79,7 @@ static __inline__ void __set_bit(int nr, volatile void *addr)
|
||||||
mask = 1 << (nr & 0x1f);
|
mask = 1 << (nr & 0x1f);
|
||||||
*a |= mask;
|
*a |= mask;
|
||||||
}
|
}
|
||||||
#define __set_bit
|
#define PLATFORM__SET_BIT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clear_bit() doesn't provide any barrier for the compiler.
|
* clear_bit() doesn't provide any barrier for the compiler.
|
||||||
|
@ -269,14 +269,6 @@ static __inline__ int find_next_zero_bit(void *addr, int size, int offset)
|
||||||
return result + ffz(tmp);
|
return result + ffz(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* ffs: find first bit set. This is defined the same way as
|
|
||||||
* the libc and compiler builtin ffs routines, therefore
|
|
||||||
* differs in spirit from the above ffz (man ffs).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define ffs(x) generic_ffs(x)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* hweightN: returns the hamming weight (i.e. the number
|
* hweightN: returns the hamming weight (i.e. the number
|
||||||
* of bits set) of a N-bit word
|
* of bits set) of a N-bit word
|
||||||
|
|
|
@ -349,7 +349,7 @@ static __inline__ int ffs(int x)
|
||||||
"1:" : "=r" (r) : "g" (x));
|
"1:" : "=r" (r) : "g" (x));
|
||||||
return r+1;
|
return r+1;
|
||||||
}
|
}
|
||||||
#define ffs
|
#define PLATFORM_FFS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hweightN - returns the hamming weight of a N-bit word
|
* hweightN - returns the hamming weight of a N-bit word
|
||||||
|
|
|
@ -51,7 +51,7 @@ extern __inline__ int ffs(int x)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
#define __ffs(x) (ffs(x) - 1)
|
#define __ffs(x) (ffs(x) - 1)
|
||||||
#define ffs
|
#define PLATFORM_FFS
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ extern void __set_bit(int nr, volatile void * addr);
|
||||||
|
|
||||||
extern void clear_bit(int nr, volatile void * addr);
|
extern void clear_bit(int nr, volatile void * addr);
|
||||||
#define __clear_bit(nr, addr) clear_bit(nr, addr)
|
#define __clear_bit(nr, addr) clear_bit(nr, addr)
|
||||||
|
#define PLATFORM__CLEAR_BIT
|
||||||
|
|
||||||
extern void change_bit(int nr, volatile void * addr);
|
extern void change_bit(int nr, volatile void * addr);
|
||||||
extern void __change_bit(int nr, volatile void * addr);
|
extern void __change_bit(int nr, volatile void * addr);
|
||||||
|
@ -75,7 +76,7 @@ extern __inline__ void __set_bit(int nr, volatile void * addr)
|
||||||
mask = 1 << (nr & 0x1f);
|
mask = 1 << (nr & 0x1f);
|
||||||
*a |= mask;
|
*a |= mask;
|
||||||
}
|
}
|
||||||
#define __set_bit
|
#define PLATFORM__SET_BIT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clear_bit() doesn't provide any barrier for the compiler.
|
* clear_bit() doesn't provide any barrier for the compiler.
|
||||||
|
|
|
@ -90,7 +90,7 @@ static __inline__ void __set_bit(int nr, volatile void * addr)
|
||||||
|
|
||||||
*m |= 1UL << (nr & 31);
|
*m |= 1UL << (nr & 31);
|
||||||
}
|
}
|
||||||
#define __set_bit
|
#define PLATFORM__SET_BIT
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* clear_bit - Clears a bit in memory
|
* clear_bit - Clears a bit in memory
|
||||||
|
@ -706,17 +706,6 @@ static __inline__ unsigned long ffz(unsigned long word)
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
#ifdef __KERNEL__
|
||||||
|
|
||||||
/**
|
|
||||||
* ffs - find first bit set
|
|
||||||
* @x: the word to search
|
|
||||||
*
|
|
||||||
* This is defined the same way as
|
|
||||||
* the libc and compiler builtin ffs routines, therefore
|
|
||||||
* differs in spirit from the above ffz (man ffs).
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define ffs(x) generic_ffs(x)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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
|
||||||
|
|
|
@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
|
||||||
extern int test_and_change_bit(int nr, volatile void * addr);
|
extern int test_and_change_bit(int nr, volatile void * addr);
|
||||||
extern int test_bit(int nr, volatile void * a);
|
extern int test_bit(int nr, volatile void * a);
|
||||||
extern int ffs(int i);
|
extern int ffs(int i);
|
||||||
#define ffs
|
#define PLATFORM_FFS
|
||||||
|
|
||||||
#endif /* _ASM_NIOS_BITOPS_H */
|
#endif /* _ASM_NIOS_BITOPS_H */
|
||||||
|
|
|
@ -33,6 +33,6 @@ extern int test_and_set_bit(int nr, volatile void * a);
|
||||||
extern int test_and_change_bit(int nr, volatile void * addr);
|
extern int test_and_change_bit(int nr, volatile void * addr);
|
||||||
extern int test_bit(int nr, volatile void * a);
|
extern int test_bit(int nr, volatile void * a);
|
||||||
extern int ffs(int i);
|
extern int ffs(int i);
|
||||||
#define ffs
|
#define PLATFORM_FFS
|
||||||
|
|
||||||
#endif /* __ASM_NIOS2_BITOPS_H */
|
#endif /* __ASM_NIOS2_BITOPS_H */
|
||||||
|
|
|
@ -178,7 +178,7 @@ static __inline__ int fls(unsigned int x)
|
||||||
{
|
{
|
||||||
return __ilog2(x) + 1;
|
return __ilog2(x) + 1;
|
||||||
}
|
}
|
||||||
#define fls
|
#define PLATFORM_FLS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fls64 - find last set bit in a 64-bit word
|
* fls64 - find last set bit in a 64-bit word
|
||||||
|
@ -231,7 +231,7 @@ extern __inline__ int ffs(int x)
|
||||||
{
|
{
|
||||||
return __ilog2(x & -x) + 1;
|
return __ilog2(x & -x) + 1;
|
||||||
}
|
}
|
||||||
#define ffs
|
#define PLATFORM_FFS
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* hweightN: returns the hamming weight (i.e. the number
|
* hweightN: returns the hamming weight (i.e. the number
|
||||||
|
|
|
@ -146,7 +146,7 @@ static inline int ffs (int x)
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
#define ffs
|
#define PLATFORM_FFS
|
||||||
|
|
||||||
#endif /* __KERNEL__ */
|
#endif /* __KERNEL__ */
|
||||||
|
|
||||||
|
|
|
@ -111,19 +111,19 @@ static inline unsigned int generic_hweight8(unsigned int w)
|
||||||
|
|
||||||
/* linux/include/asm-generic/bitops/non-atomic.h */
|
/* linux/include/asm-generic/bitops/non-atomic.h */
|
||||||
|
|
||||||
#ifndef __set_bit
|
#ifndef PLATFORM__SET_BIT
|
||||||
# define __set_bit generic_set_bit
|
# define __set_bit generic_set_bit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __clear_bit
|
#ifndef PLATFORM__CLEAR_BIT
|
||||||
# define __clear_bit generic_clear_bit
|
# define __clear_bit generic_clear_bit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ffs
|
#ifndef PLATFORM_FFS
|
||||||
# define ffs generic_ffs
|
# define ffs generic_ffs
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef fls
|
#ifndef PLATFORM_FLS
|
||||||
# define fls generic_fls
|
# define fls generic_fls
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue