diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2012-02-24 08:23:23 +0400 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2012-02-24 08:23:23 +0400 |
| commit | 35eb304b5cd7b49d581bda79218b8134f3b689ea (patch) | |
| tree | 3d75d9ada70814161d035b2f9166fee05d257dfb /include/linux/bitops.h | |
| parent | ca0cc30109241f280eb871794620d7cf198bb582 (diff) | |
| parent | bb4c7e9a9908548b458f34afb2fee74dc0d49f90 (diff) | |
| download | linux-35eb304b5cd7b49d581bda79218b8134f3b689ea.tar.xz | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into rmobile-fixes-for-linus
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 3c1063acb2ab..94300fe46cce 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -56,6 +56,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 |
