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
This commit is contained in:
Bjoern A. Zeeb 2021-05-24 18:38:58 +00:00
parent fa58da02f7
commit 10096cb606

View File

@ -63,6 +63,15 @@ get_random_long(void)
return (val); return (val);
} }
static __inline uint32_t
prandom_u32(void)
{
uint32_t val;
get_random_bytes(&val, sizeof(val));
return (val);
}
static inline u32 static inline u32
prandom_u32_max(u32 max) prandom_u32_max(u32 max)
{ {