diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-02-19 00:24:05 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-02-19 00:24:05 +0100 |
commit | a18d3afefa0104419b5e069af5922bb57a302426 (patch) | |
tree | 4bcc6010e2eb46d5d40454c4c9276f1ec6c7fd73 /include | |
parent | i387: re-introduce FPU state preloading at context switch time (diff) | |
parent | crypto: sha512 - use standard ror64() (diff) | |
download | linux-a18d3afefa0104419b5e069af5922bb57a302426.tar.xz linux-a18d3afefa0104419b5e069af5922bb57a302426.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: sha512 - use standard ror64()
Diffstat (limited to 'include')
-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 |