From 5cdbfcb1a2cf4b4ded5bff0b970f29e18fada454 Mon Sep 17 00:00:00 2001 From: markm Date: Sun, 23 Jul 2000 11:08:16 +0000 Subject: 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. --- sys/dev/randomdev/harvest.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'sys/dev/randomdev/harvest.c') diff --git a/sys/dev/randomdev/harvest.c b/sys/dev/randomdev/harvest.c index 591d0d0..3e16059 100644 --- a/sys/dev/randomdev/harvest.c +++ b/sys/dev/randomdev/harvest.c @@ -39,8 +39,9 @@ #include -/* 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); } } -- cgit v1.1