linuxkpi: Add rol32()

`rol64()` and `rol32()` are used by <linux/siphash.h>. The former was
added previously, before <linux/siphash.h> was added. However the latter
was not, and it broke the build on armv7.

Reported by:	adrian
Reviewed by:	adrian, rpokala
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54588
This commit is contained in:
Jean-Sébastien Pédron 2026-01-07 22:18:38 +01:00
parent 10c6f1f627
commit 6c0bcd15e4
No known key found for this signature in database
GPG key ID: 39E99761A5FD94CC

View file

@ -443,4 +443,10 @@ rol64(uint64_t word, unsigned int shift)
return ((word << (shift & 63)) | (word >> ((-shift) & 63)));
}
static inline uint32_t
rol32(uint32_t word, unsigned int shift)
{
return ((word << (shift & 31)) | (word >> ((-shift) & 31)));
}
#endif /* _LINUXKPI_LINUX_BITOPS_H_ */