summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2013-09-27 17:31:07 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2013-09-27 17:31:07 +1000
commit888324a7cc75d5b39a5c8407d18791ea25b770aa (patch)
tree317ba8f51f5609ad997e76c5494a2e2b4be289e4 /include/linux
parentafde8cb0f6517d97d37f1061d108032703cb3bfc (diff)
parent45ee64e1f474fa027efa966fbe8db8df700d18e5 (diff)
Merge remote-tracking branch 'random/dev'
Conflicts: init/main.c
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/random.h1
-rw-r--r--include/linux/timex.h14
2 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index 3b9377d6b7a5..6312dd9ba449 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -17,6 +17,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags);
extern void get_random_bytes(void *buf, int nbytes);
extern void get_random_bytes_arch(void *buf, int nbytes);
void generate_random_uuid(unsigned char uuid_out[16]);
+extern int random_int_secret_init(void);
#ifndef MODULE
extern const struct file_operations random_fops, urandom_fops;
diff --git a/include/linux/timex.h b/include/linux/timex.h
index dd3edd7dfc94..9d3f1a5b6178 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -64,6 +64,20 @@
#include <asm/timex.h>
+#ifndef random_get_entropy
+/*
+ * The random_get_entropy() function is used by the /dev/random driver
+ * in order to extract entropy via the relative unpredictability of
+ * when an interrupt takes places versus a high speed, fine-grained
+ * timing source or cycle counter. Since it will be occurred on every
+ * single interrupt, it must have a very low cost/overhead.
+ *
+ * By default we use get_cycles() for this purpose, but individual
+ * architectures may override this in their asm/timex.h header file.
+ */
+#define random_get_entropy() get_cycles()
+#endif
+
/*
* SHIFT_PLL is used as a dampening factor to define how much we
* adjust the frequency correction for a given offset in PLL mode.