aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/bitops.h20
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)
50} 50}
51 51
52/** 52/**
53 * rol64 - rotate a 64-bit value left
54 * @word: value to rotate
55 * @shift: bits to roll
56 */
57static inline __u64 rol64(__u64 word, unsigned int shift)
58{
59 return (word << shift) | (word >> (64 - shift));
60}
61
62/**
63 * ror64 - rotate a 64-bit value right
64 * @word: value to rotate
65 * @shift: bits to roll
66 */
67static inline __u64 ror64(__u64 word, unsigned int shift)
68{
69 return (word >> shift) | (word << (64 - shift));
70}
71
72/**
53 * rol32 - rotate a 32-bit value left 73 * rol32 - rotate a 32-bit value left
54 * @word: value to rotate 74 * @word: value to rotate
55 * @shift: bits to roll 75 * @shift: bits to roll