summaryrefslogtreecommitdiff
path: root/datapath/linux/compat/include/linux/random.h
blob: 5c088a2d860bf9b5b70650db58dc6c60f89f4f9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef __LINUX_RANDOM_WRAPPER_H
#define __LINUX_RANDOM_WRAPPER_H 1

#include_next <linux/random.h>

#ifndef HAVE_PRANDOM_U32
#define prandom_u32()		random32()
#endif

#ifndef HAVE_PRANDOM_U32_MAX
static inline u32 prandom_u32_max(u32 ep_ro)
{
	return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
}
#endif

#endif