aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/linux/bitops.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/linux/bitops.h')
-rw-r--r--tools/include/linux/bitops.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h
index 1aecad369af5..969db1981868 100644
--- a/tools/include/linux/bitops.h
+++ b/tools/include/linux/bitops.h
@@ -61,4 +61,14 @@ static inline unsigned fls_long(unsigned long l)
return fls64(l);
}
+/**
+ * rol32 - rotate a 32-bit value left
+ * @word: value to rotate
+ * @shift: bits to roll
+ */
+static inline __u32 rol32(__u32 word, unsigned int shift)
+{
+ return (word << shift) | (word >> ((-shift) & 31));
+}
+
#endif