aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/random.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 6330ed47b38b..db6debc6649e 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -25,10 +25,17 @@ extern const struct file_operations random_fops, urandom_fops;
25unsigned int get_random_int(void); 25unsigned int get_random_int(void);
26unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); 26unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
27 27
28u32 random32(void); 28u32 prandom_u32(void);
29void srandom32(u32 seed); 29void prandom_seed(u32 seed);
30 30
31u32 prandom32(struct rnd_state *); 31/*
32 * These macros are preserved for backward compatibility and should be
33 * removed as soon as a transition is finished.
34 */
35#define random32() prandom_u32()
36#define srandom32(seed) prandom_seed(seed)
37
38u32 prandom_u32_state(struct rnd_state *);
32 39
33/* 40/*
34 * Handle minimum values for seeds 41 * Handle minimum values for seeds
@@ -39,11 +46,11 @@ static inline u32 __seed(u32 x, u32 m)
39} 46}
40 47
41/** 48/**
42 * prandom32_seed - set seed for prandom32(). 49 * prandom_seed_state - set seed for prandom_u32_state().
43 * @state: pointer to state structure to receive the seed. 50 * @state: pointer to state structure to receive the seed.
44 * @seed: arbitrary 64-bit value to use as a seed. 51 * @seed: arbitrary 64-bit value to use as a seed.
45 */ 52 */
46static inline void prandom32_seed(struct rnd_state *state, u64 seed) 53static inline void prandom_seed_state(struct rnd_state *state, u64 seed)
47{ 54{
48 u32 i = (seed >> 32) ^ (seed << 10) ^ seed; 55 u32 i = (seed >> 32) ^ (seed << 10) ^ seed;
49 56