diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2012-02-27 14:04:40 -0700 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2012-02-27 14:04:40 -0700 |
| commit | 29f141fed01a09050207c4d41fc5811520d81146 (patch) | |
| tree | c55a51dca4a0e4da9fdc2b904eefbde37d2a5b03 /include/linux/bitops.h | |
| parent | 2261cc627f5453004042b4f694612edae27e492e (diff) | |
| parent | 14cd3c15cfc8118586262a79bfa3b3123f13e2c2 (diff) | |
Merge branch 'fixes-for-grant' of git://sources.calxeda.com/kernel/linux into devicetree/merge
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 |
