git: 5d1539f8401e - stable/15 - linuxkpi: Add `rol64()`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 22 Apr 2026 21:08:10 UTC
The branch stable/15 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=5d1539f8401eff8fc2c1e424ff4782ee15882234
commit 5d1539f8401eff8fc2c1e424ff4782ee15882234
Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2025-09-07 23:22:22 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-22 20:56:55 +0000
linuxkpi: Add `rol64()`
This is used by <linux/siphash.h> added in a separate future commit.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54499
(cherry picked from commit a9462e32fa75a9a1e3f49964bc42b5303e0dd092)
---
sys/compat/linuxkpi/common/include/linux/bitops.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h
index e34ba391421a..427d52b0dc81 100644
--- a/sys/compat/linuxkpi/common/include/linux/bitops.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitops.h
@@ -437,4 +437,10 @@ sign_extend32(uint32_t value, int index)
return ((int32_t)(value << shift) >> shift);
}
+static inline uint64_t
+rol64(uint64_t word, unsigned int shift)
+{
+ return ((word << (shift & 63)) | (word >> ((-shift) & 63)));
+}
+
#endif /* _LINUXKPI_LINUX_BITOPS_H_ */