summaryrefslogtreecommitdiffstats
path: root/include/linux/random.h
diff options
context:
space:
mode:
authorLinus Torvalds2011-10-28 14:29:07 +0200
committerLinus Torvalds2011-10-28 14:29:07 +0200
commit8e6d539e0fd0c2124a20a207da70f2af7a9ae52c (patch)
tree73016c1bdb5005125cdb5d60d48f73ab4300be64 /include/linux/random.h
parentMerge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/... (diff)
parentx86, random: Verify RDRAND functionality and allow it to be disabled (diff)
downloadkernel-qcow2-linux-8e6d539e0fd0c2124a20a207da70f2af7a9ae52c.tar.gz
kernel-qcow2-linux-8e6d539e0fd0c2124a20a207da70f2af7a9ae52c.tar.xz
kernel-qcow2-linux-8e6d539e0fd0c2124a20a207da70f2af7a9ae52c.zip
Merge branch 'x86-rdrand-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-rdrand-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, random: Verify RDRAND functionality and allow it to be disabled x86, random: Architectural inlines to get random integers with RDRAND random: Add support for architectural random hooks Fix up trivial conflicts in drivers/char/random.c: the architectural random hooks touched "get_random_int()" that was simplified to use MD5 and not do the keyptr thing any more (see commit 6e5714eaf77d: "net: Compute protocol sequence numbers and fragment IDs using MD5").
Diffstat (limited to 'include/linux/random.h')
-rw-r--r--include/linux/random.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/random.h b/include/linux/random.h
index d13059f3ea32..8f74538c96db 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -91,6 +91,19 @@ static inline void prandom32_seed(struct rnd_state *state, u64 seed)
state->s3 = __seed(i, 15);
}
+#ifdef CONFIG_ARCH_RANDOM
+# include <asm/archrandom.h>
+#else
+static inline int arch_get_random_long(unsigned long *v)
+{
+ return 0;
+}
+static inline int arch_get_random_int(unsigned int *v)
+{
+ return 0;
+}
+#endif
+
#endif /* __KERNEL___ */
#endif /* _LINUX_RANDOM_H */