diff options
| author | tls <tls@NetBSD.org> | 2012-02-02 19:42:57 +0000 |
|---|---|---|
| committer | tls <tls@NetBSD.org> | 2012-02-02 19:42:57 +0000 |
| commit | cc9ee3de3e25ef31d3a97dc35bedc36945e35d2a (patch) | |
| tree | 06a2889eb6b4b02bc8b8bba6b5cc3f9b1938d18b /sys/dev/mca | |
| parent | f622122a62827e27b444c2f95632d61f73357ced (diff) | |
Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.
2) Remove use of NRND as test for presence of entropy-pool code throughout
source tree.
3) Remove use of RND_ENABLED in device drivers as microoptimization to
avoid expensive operations on disabled entropy sources; make the
rnd_add calls do this directly so all callers benefit.
4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
have lead to slight entropy overestimation for some sources.
5) Add new source types for environmental sensors, power sensors, VM
system events, and skew between clocks, with a sample implementation
for each.
ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
Diffstat (limited to 'sys/dev/mca')
| -rw-r--r-- | sys/dev/mca/ed_mca.c | 10 | ||||
| -rw-r--r-- | sys/dev/mca/edc_mca.c | 10 | ||||
| -rw-r--r-- | sys/dev/mca/edvar.h | 4 |
3 files changed, 5 insertions, 19 deletions
diff --git a/sys/dev/mca/ed_mca.c b/sys/dev/mca/ed_mca.c index cda2cf7c6cc..7a3cfdcb543 100644 --- a/sys/dev/mca/ed_mca.c +++ b/sys/dev/mca/ed_mca.c @@ -1,4 +1,4 @@ -/* $NetBSD: ed_mca.c,v 1.48 2011/08/07 13:39:24 rmind Exp $ */ +/* $NetBSD: ed_mca.c,v 1.49 2012/02/02 19:43:04 tls Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -34,9 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.48 2011/08/07 13:39:24 rmind Exp $"); - -#include "rnd.h" +__KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.49 2012/02/02 19:43:04 tls Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,9 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: ed_mca.c,v 1.48 2011/08/07 13:39:24 rmind Exp $"); #include <sys/syslog.h> #include <sys/proc.h> #include <sys/vnode.h> -#if NRND > 0 #include <sys/rnd.h> -#endif #include <sys/intr.h> #include <sys/bus.h> @@ -176,10 +172,8 @@ ed_mca_attach(device_t parent, device_t self, void *aux) */ disk_init(&ed->sc_dk, device_xname(&ed->sc_dev), &eddkdriver); disk_attach(&ed->sc_dk); -#if NRND > 0 rnd_attach_source(&ed->rnd_source, device_xname(&ed->sc_dev), RND_TYPE_DISK, 0); -#endif ed->sc_flags |= EDF_INIT; diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c index a69b8c3f861..b43ebf3cbce 100644 --- a/sys/dev/mca/edc_mca.c +++ b/sys/dev/mca/edc_mca.c @@ -1,4 +1,4 @@ -/* $NetBSD: edc_mca.c,v 1.45 2011/08/07 13:39:24 rmind Exp $ */ +/* $NetBSD: edc_mca.c,v 1.46 2012/02/02 19:43:04 tls Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -46,9 +46,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.45 2011/08/07 13:39:24 rmind Exp $"); - -#include "rnd.h" +__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.46 2012/02/02 19:43:04 tls Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -65,9 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.45 2011/08/07 13:39:24 rmind Exp $"); #include <sys/vnode.h> #include <sys/kernel.h> #include <sys/kthread.h> -#if NRND > 0 #include <sys/rnd.h> -#endif #include <sys/bus.h> #include <sys/intr.h> @@ -840,9 +836,7 @@ edcworker(void *arg) disk_unbusy(&ed->sc_dk, (bp->b_bcount - bp->b_resid), (bp->b_flags & B_READ)); -#if NRND > 0 rnd_add_uint32(&ed->rnd_source, bp->b_blkno); -#endif biodone(bp); } } diff --git a/sys/dev/mca/edvar.h b/sys/dev/mca/edvar.h index b7262dfb13f..c2d7944a355 100644 --- a/sys/dev/mca/edvar.h +++ b/sys/dev/mca/edvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: edvar.h,v 1.14 2011/11/19 22:51:23 tls Exp $ */ +/* $NetBSD: edvar.h,v 1.15 2012/02/02 19:43:04 tls Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -60,7 +60,5 @@ struct ed_softc { u_int8_t spares; /* spares per cylinder */ u_int32_t rba; /* # of RBAs */ -#if NRND > 0 krndsource_t rnd_source; -#endif }; |
