Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
random.c File Reference
#include <linux/utsname.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/string.h>
#include <linux/fcntl.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
#include <linux/percpu.h>
#include <linux/cryptohash.h>
#include <linux/fips.h>
#include <linux/ptrace.h>
#include <linux/kmemcheck.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/irq.h>
#include <asm/irq_regs.h>
#include <asm/io.h>
#include <trace/events/random.h>

Go to the source code of this file.

Data Structures

struct  poolinfo
 
struct  entropy_store
 
struct  fast_pool
 
struct  timer_rand_state
 

Macros

#define CREATE_TRACE_POINTS
 
#define INPUT_POOL_WORDS   128
 
#define OUTPUT_POOL_WORDS   32
 
#define SEC_XFER_SIZE   512
 
#define EXTRACT_SIZE   10
 
#define LONGS(x)   (((x) + sizeof(unsigned long) - 1)/sizeof(unsigned long))
 
#define POOLBITS   poolwords*32
 
#define POOLBYTES   poolwords*4
 
#define DEBUG_ENT(fmt, arg...)   do {} while (0)
 

Functions

void add_device_randomness (const void *buf, unsigned int size)
 
 EXPORT_SYMBOL (add_device_randomness)
 
void add_input_randomness (unsigned int type, unsigned int code, unsigned int value)
 
 EXPORT_SYMBOL_GPL (add_input_randomness)
 
void add_interrupt_randomness (int irq, int irq_flags)
 
void get_random_bytes (void *buf, int nbytes)
 
 EXPORT_SYMBOL (get_random_bytes)
 
void get_random_bytes_arch (void *buf, int nbytes)
 
 EXPORT_SYMBOL (get_random_bytes_arch)
 
 module_init (rand_initialize)
 
void generate_random_uuid (unsigned char uuid_out[16])
 
 EXPORT_SYMBOL (generate_random_uuid)
 
 late_initcall (random_int_secret_init)
 
unsigned int get_random_int (void)
 
unsigned long randomize_range (unsigned long start, unsigned long end, unsigned long len)
 

Variables

struct file_operations random_fops
 
struct file_operations urandom_fops
 

Macro Definition Documentation

#define CREATE_TRACE_POINTS

Definition at line 269 of file random.c.

#define DEBUG_ENT (   fmt,
  arg... 
)    do {} while (0)

Definition at line 414 of file random.c.

#define EXTRACT_SIZE   10

Definition at line 278 of file random.c.

#define INPUT_POOL_WORDS   128

Definition at line 275 of file random.c.

#define LONGS (   x)    (((x) + sizeof(unsigned long) - 1)/sizeof(unsigned long))

Definition at line 280 of file random.c.

#define OUTPUT_POOL_WORDS   32

Definition at line 276 of file random.c.

#define POOLBITS   poolwords*32

Definition at line 349 of file random.c.

#define POOLBYTES   poolwords*4

Definition at line 350 of file random.c.

#define SEC_XFER_SIZE   512

Definition at line 277 of file random.c.

Function Documentation

void add_device_randomness ( const void buf,
unsigned int  size 
)

Definition at line 647 of file random.c.

void add_input_randomness ( unsigned int  type,
unsigned int  code,
unsigned int  value 
)

Definition at line 729 of file random.c.

void add_interrupt_randomness ( int  irq,
int  irq_flags 
)

Definition at line 747 of file random.c.

EXPORT_SYMBOL ( add_device_randomness  )
EXPORT_SYMBOL ( get_random_bytes  )
EXPORT_SYMBOL ( get_random_bytes_arch  )
EXPORT_SYMBOL ( generate_random_uuid  )
EXPORT_SYMBOL_GPL ( add_input_randomness  )
void generate_random_uuid ( unsigned char  uuid_out[16])

Definition at line 1324 of file random.c.

void get_random_bytes ( void buf,
int  nbytes 
)

Definition at line 1033 of file random.c.

void get_random_bytes_arch ( void buf,
int  nbytes 
)

Definition at line 1049 of file random.c.

unsigned int get_random_int ( void  )

Definition at line 1453 of file random.c.

late_initcall ( random_int_secret_init  )
module_init ( rand_initialize  )
unsigned long randomize_range ( unsigned long  start,
unsigned long  end,
unsigned long  len 
)

Definition at line 1481 of file random.c.

Variable Documentation

struct file_operations random_fops
Initial value:
= {
.read = random_read,
.write = random_write,
.poll = random_poll,
.unlocked_ioctl = random_ioctl,
.fasync = random_fasync,
.llseek = noop_llseek,
}

Definition at line 1297 of file random.c.

struct file_operations urandom_fops
Initial value:
= {
.read = urandom_read,
.write = random_write,
.unlocked_ioctl = random_ioctl,
.fasync = random_fasync,
.llseek = noop_llseek,
}

Definition at line 1306 of file random.c.