summaryrefslogtreecommitdiffstats
path: root/sys/dev/random
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-10-18 19:29:13 +0000
committerrwatson <rwatson@FreeBSD.org>2004-10-18 19:29:13 +0000
commit7b853afb002723c73c5121562d0e6da52a480cc5 (patch)
tree742d82a474c6d0866e99ab6b048456daac520052 /sys/dev/random
parentd7592a9bb71c5d4e974dc936db80faaa5291b5cd (diff)
downloadFreeBSD-src-7b853afb002723c73c5121562d0e6da52a480cc5.zip
FreeBSD-src-7b853afb002723c73c5121562d0e6da52a480cc5.tar.gz
Annotate that get_cyclecount() can be expensive on some platforms,
which juxtaposes nicely with the comment just above on how the harvest function must be cheap.
Diffstat (limited to 'sys/dev/random')
-rw-r--r--sys/dev/random/harvest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/random/harvest.c b/sys/dev/random/harvest.c
index 0ffa83e..d783065 100644
--- a/sys/dev/random/harvest.c
+++ b/sys/dev/random/harvest.c
@@ -77,6 +77,10 @@ random_yarrow_deinit_harvester(void)
* not do anything slow in here!
* Implemented as in indirect call to allow non-inclusion of
* the entropy device.
+ *
+ * XXXRW: get_cyclecount() is cheap on most modern hardware, where cycle
+ * counters are built in, but on older hardware it will do a real time clock
+ * read which can be quite expensive.
*/
void
random_harvest(void *entropy, u_int count, u_int bits, u_int frac,
OpenPOWER on IntegriCloud