提交 50190edb 编写于 作者: G Geert Uytterhoeven

m68k/amiga: Provide mach_random_get_entropy()

Use the beam position registers, which provide at least 17 bits of data
changing at 1.79 MHz.
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
上级 017cecee
...@@ -360,6 +360,14 @@ static void __init amiga_identify(void) ...@@ -360,6 +360,14 @@ static void __init amiga_identify(void)
#undef AMIGAHW_ANNOUNCE #undef AMIGAHW_ANNOUNCE
} }
static unsigned long amiga_random_get_entropy(void)
{
/* VPOSR/VHPOSR provide at least 17 bits of data changing at 1.79 MHz */
return *(unsigned long *)&amiga_custom.vposr;
}
/* /*
* Setup the Amiga configuration info * Setup the Amiga configuration info
*/ */
...@@ -397,6 +405,8 @@ void __init config_amiga(void) ...@@ -397,6 +405,8 @@ void __init config_amiga(void)
mach_heartbeat = amiga_heartbeat; mach_heartbeat = amiga_heartbeat;
#endif #endif
mach_random_get_entropy = amiga_random_get_entropy;
/* Fill in the clock value (based on the 700 kHz E-Clock) */ /* Fill in the clock value (based on the 700 kHz E-Clock) */
amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册