aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/random.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/random.h')
-rw-r--r--include/linux/random.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 7bd2403e4fef..ed5c3838780d 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -37,14 +37,26 @@ extern void get_random_bytes(void *buf, int nbytes);
37extern int add_random_ready_callback(struct random_ready_callback *rdy); 37extern int add_random_ready_callback(struct random_ready_callback *rdy);
38extern void del_random_ready_callback(struct random_ready_callback *rdy); 38extern void del_random_ready_callback(struct random_ready_callback *rdy);
39extern void get_random_bytes_arch(void *buf, int nbytes); 39extern void get_random_bytes_arch(void *buf, int nbytes);
40extern int random_int_secret_init(void);
41 40
42#ifndef MODULE 41#ifndef MODULE
43extern const struct file_operations random_fops, urandom_fops; 42extern const struct file_operations random_fops, urandom_fops;
44#endif 43#endif
45 44
46unsigned int get_random_int(void); 45u32 get_random_u32(void);
47unsigned long get_random_long(void); 46u64 get_random_u64(void);
47static inline unsigned int get_random_int(void)
48{
49 return get_random_u32();
50}
51static inline unsigned long get_random_long(void)
52{
53#if BITS_PER_LONG == 64
54 return get_random_u64();
55#else
56 return get_random_u32();
57#endif
58}
59
48unsigned long randomize_page(unsigned long start, unsigned long range); 60unsigned long randomize_page(unsigned long start, unsigned long range);
49 61
50u32 prandom_u32(void); 62u32 prandom_u32(void);