aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include/asm
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-10-18 13:10:08 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-11-26 11:09:24 +0100
commit017cecee99d897ae426f3948e7b970eb4f95e1f4 (patch)
tree449551864d0ded68749b52dc6b60142c9666d187 /arch/m68k/include/asm
parentm68k/atari: Call paging_init() before nf_init() (diff)
downloadlinux-dev-017cecee99d897ae426f3948e7b970eb4f95e1f4.tar.xz
linux-dev-017cecee99d897ae426f3948e7b970eb4f95e1f4.zip
m68k: Add infrastructure for machine-specific random_get_entropy()
On m68k, get_cycles() (the default implementation for random_get_entropy()) always returns zero, providing no entropy for the random driver. Add a hook where platforms can provide their own implementation, and wire it up in the infrastructure provided by commit 61875f30daf60305712e25b209ef41ced2635bad ("random: allow architectures to optionally define random_get_entropy()"). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/include/asm')
-rw-r--r--arch/m68k/include/asm/timex.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/timex.h b/arch/m68k/include/asm/timex.h
index 6759dad954f6..efc1f4892357 100644
--- a/arch/m68k/include/asm/timex.h
+++ b/arch/m68k/include/asm/timex.h
@@ -28,4 +28,14 @@ static inline cycles_t get_cycles(void)
return 0;
}
+extern unsigned long (*mach_random_get_entropy)(void);
+
+static inline unsigned long random_get_entropy(void)
+{
+ if (mach_random_get_entropy)
+ return mach_random_get_entropy();
+ return 0;
+}
+#define random_get_entropy random_get_entropy
+
#endif