Date: Sun, 18 Jul 2021 00:36:15 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 17b99aa321ba - stable/13 - LinuxKPI: add prandom_u32() as used by wireless drivers. Message-ID: <202107180036.16I0aFUF048880@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=17b99aa321babea211652f7799f0fcf7d1e55361 commit 17b99aa321babea211652f7799f0fcf7d1e55361 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2021-05-24 18:38:58 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2021-07-18 00:35:00 +0000 LinuxKPI: add prandom_u32() as used by wireless drivers. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D30435 (cherry picked from commit 10096cb60619984eefc628471f219d4723867bb1) --- sys/compat/linuxkpi/common/include/linux/random.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/random.h b/sys/compat/linuxkpi/common/include/linux/random.h index 31d8b996aa0b..12de0e12bc5a 100644 --- a/sys/compat/linuxkpi/common/include/linux/random.h +++ b/sys/compat/linuxkpi/common/include/linux/random.h @@ -63,6 +63,15 @@ get_random_long(void) return (val); } +static __inline uint32_t +prandom_u32(void) +{ + uint32_t val; + + get_random_bytes(&val, sizeof(val)); + return (val); +} + static inline u32 prandom_u32_max(u32 max) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107180036.16I0aFUF048880>