Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom Get some entropy early on bcm2835_rng ...



details:   https://anonhg.NetBSD.org/src/rev/307a0c1d6b4d
branches:  trunk
changeset: 789631:307a0c1d6b4d
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 28 18:32:45 2013 +0000

description:
Get some entropy early on bcm2835_rng attach.

diffstat:

 sys/arch/arm/broadcom/bcm2835_rng.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 00fc2af26ec4 -r 307a0c1d6b4d sys/arch/arm/broadcom/bcm2835_rng.c
--- a/sys/arch/arm/broadcom/bcm2835_rng.c       Wed Aug 28 18:01:22 2013 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_rng.c       Wed Aug 28 18:32:45 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_rng.c,v 1.7 2013/08/25 17:08:41 tls Exp $ */
+/*     $NetBSD: bcm2835_rng.c,v 1.8 2013/08/28 18:32:45 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_rng.c,v 1.7 2013/08/25 17:08:41 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_rng.c,v 1.8 2013/08/28 18:32:45 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -117,6 +117,9 @@
        ctrl = bus_space_read_4(sc->sc_iot, sc->sc_ioh, RNG_CTRL);
        ctrl |= RNG_CTRL_EN;
        bus_space_write_4(sc->sc_iot, sc->sc_ioh, RNG_CTRL, ctrl);
+
+       /* get some initial entropy ASAP */
+       bcmrng_get(RND_POOLBITS / NBBY, sc);
 }
 
 static void



Home | Main Index | Thread Index | Old Index