/* * Include this here because some architectures need generic_ffs/fls in * scope * * XXX: this needs to be asm/bitops.h, when we get to per arch optimizations
*/ #include <asm-generic/bitops.h>
/* same as for_each_set_bit() but use bit as value to start with */ #define for_each_set_bit_from(bit, addr, size) \ for ((bit) = find_next_bit((addr), (size), (bit)); \
(bit) < (size); \
(bit) = find_next_bit((addr), (size), (bit) + 1))
/** * rol32 - rotate a 32-bit value left * @word: value to rotate * @shift: bits to roll
*/ staticinline __u32 rol32(__u32 word, unsignedint shift)
{ return (word << shift) | (word >> ((-shift) & 31));
}
/** * sign_extend64 - sign extend a 64-bit value using specified bit as sign-bit * @value: value to sign extend * @index: 0 based bit index (0<=index<64) to sign bit
*/ static __always_inline __s64 sign_extend64(__u64 value, int index)
{
__u8 shift = 63 - index; return (__s64)(value << shift) >> shift;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.