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:
parent
fa58da02f7
commit
10096cb606
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user