git: 7f88d742e578 - main - LinuxKPI: Add get_random_u64() function

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Sun, 24 Dec 2023 08:23:16 UTC
The branch main has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f88d742e578c4cef4e26ce10b9a936e58237964

commit 7f88d742e578c4cef4e26ce10b9a936e58237964
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2023-12-24 08:20:00 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2023-12-24 08:20:00 +0000

    LinuxKPI: Add get_random_u64() function
    
    Sponsored by:   Serenity Cyber Security, LLC
    Reviewed by:    manu, bz
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D42816
---
 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 5335cca8251c..e87d4412ea4e 100644
--- a/sys/compat/linuxkpi/common/include/linux/random.h
+++ b/sys/compat/linuxkpi/common/include/linux/random.h
@@ -87,6 +87,15 @@ get_random_long(void)
 	return (val);
 }
 
+static inline uint64_t
+get_random_u64(void)
+{
+	uint64_t val;
+
+	get_random_bytes(&val, sizeof(val));
+	return (val);
+}
+
 static __inline uint32_t
 prandom_u32(void)
 {