diff options
author | markm <markm@FreeBSD.org> | 2000-07-23 11:08:16 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2000-07-23 11:08:16 +0000 |
commit | 5cdbfcb1a2cf4b4ded5bff0b970f29e18fada454 (patch) | |
tree | 21be041cff086690f613f725fd550c3d4efd3aad /sys/dev/random/harvest.c | |
parent | 230f54e2d8923fa7f9d8407246ac8735f0245caf (diff) | |
download | FreeBSD-src-5cdbfcb1a2cf4b4ded5bff0b970f29e18fada454.zip FreeBSD-src-5cdbfcb1a2cf4b4ded5bff0b970f29e18fada454.tar.gz |
Clean this up with some BDE-inspired fixes.
o Make the comments KNF-compliant.
o Use nanotime instead of getnanotime; the manpage lies about the
kern.timecounter.method - it has been removed.
o Fix the ENTROPYSOURCE const permanently.
o Make variable names more consistent.
o Make function prototypes more consistent.
Some more needs to be done; to follow.
Diffstat (limited to 'sys/dev/random/harvest.c')
-rw-r--r-- | sys/dev/random/harvest.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/random/harvest.c b/sys/dev/random/harvest.c index 591d0d0..3e16059 100644 --- a/sys/dev/random/harvest.c +++ b/sys/dev/random/harvest.c @@ -39,8 +39,9 @@ #include <dev/randomdev/yarrow.h> -/* hold the address of the routine which is actually called if */ -/* the ramdomdev is loaded */ +/* hold the address of the routine which is actually called if + * the ramdomdev is loaded + */ static void (*reap)(struct timespec *, u_int64_t, u_int, u_int, u_int) = NULL; /* Initialise the harvester at load time */ @@ -57,17 +58,18 @@ random_deinit_harvester(void) reap = NULL; } -/* Entropy harvesting routine. This is supposed to be fast; do */ -/* not do anything slow in here! */ -/* Implemented as in indirect call to allow non-inclusion of */ -/* the entropy device. */ +/* Entropy harvesting routine. This is supposed to be fast; do + * not do anything slow in here! + * Implemented as in indirect call to allow non-inclusion of + * the entropy device. + */ void -random_harvest(u_int64_t entropy, u_int bits, u_int frac, u_int source) +random_harvest(u_int64_t entropy, u_int bits, u_int frac, u_int origin) { - struct timespec nanotime; + struct timespec timebuf; if (reap) { - getnanotime(&nanotime); - (*reap)(&nanotime, entropy, bits, frac, source); + nanotime(&timebuf); + (*reap)(&timebuf, entropy, bits, frac, origin); } } |