Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 May 2021 18:14:58 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 10096cb60619 - main - LinuxKPI: add prandom_u32() as used by wireless drivers.
Message-ID:  <202105251814.14PIEw26043792@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=10096cb60619984eefc628471f219d4723867bb1

commit 10096cb60619984eefc628471f219d4723867bb1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-05-24 18:38:58 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2021-05-25 18:01:46 +0000

    LinuxKPI: add prandom_u32() as used by wireless drivers.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      2 weeks
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D30435
---
 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?202105251814.14PIEw26043792>