forked from KolibriOS/kolibrios
DDK update - includes
git-svn-id: svn://kolibrios.org@1970 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -109,6 +109,17 @@ static inline __u8 ror8(__u8 word, unsigned int shift)
|
||||
return (word >> shift) | (word << (8 - shift));
|
||||
}
|
||||
|
||||
/**
|
||||
* sign_extend32 - sign extend a 32-bit value using specified bit as sign-bit
|
||||
* @value: value to sign extend
|
||||
* @index: 0 based bit index (0<=index<32) to sign bit
|
||||
*/
|
||||
static inline __s32 sign_extend32(__u32 value, int index)
|
||||
{
|
||||
__u8 shift = 31 - index;
|
||||
return (__s32)(value << shift) >> shift;
|
||||
}
|
||||
|
||||
static inline unsigned fls_long(unsigned long l)
|
||||
{
|
||||
if (sizeof(l) == 4)
|
||||
@@ -137,7 +148,7 @@ static inline unsigned long __ffs64(u64 word)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#ifdef CONFIG_GENERIC_FIND_LAST_BIT
|
||||
#ifndef find_last_bit
|
||||
/**
|
||||
* find_last_bit - find the last set bit in a memory region
|
||||
* @addr: The address to start the search at
|
||||
@@ -147,7 +158,7 @@ static inline unsigned long __ffs64(u64 word)
|
||||
*/
|
||||
extern unsigned long find_last_bit(const unsigned long *addr,
|
||||
unsigned long size);
|
||||
#endif /* CONFIG_GENERIC_FIND_LAST_BIT */
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user