diff options
author | Clark Williams <williams@redhat.com> | 2012-02-23 21:33:05 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-02-23 21:33:05 -0600 |
commit | a0c034c3726715d1928b301ddd43c51799c0c07a (patch) | |
tree | 76e78b4646ca0560d8cd0ee041a8bde9a5269c8c /include/linux/bitops.h | |
parent | 086290148fc37d7f2eccb7026b18fb9539ec7820 (diff) | |
parent | 9d0231c207faeda051cf54c1a64e1a147d2187fa (diff) |
Merge commit 'v3.2.7' into rt-3.2.7-rt13v3.2.7-rt13
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r-- | include/linux/bitops.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a3ef66a2a083..fc8a3ffce320 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -50,6 +50,26 @@ static inline unsigned long hweight_long(unsigned long w) } /** + * rol64 - rotate a 64-bit value left + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u64 rol64(__u64 word, unsigned int shift) +{ + return (word << shift) | (word >> (64 - shift)); +} + +/** + * ror64 - rotate a 64-bit value right + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u64 ror64(__u64 word, unsigned int shift) +{ + return (word >> shift) | (word << (64 - shift)); +} + +/** * rol32 - rotate a 32-bit value left * @word: value to rotate * @shift: bits to roll |