From 8f30dde5fee772ca49e9719d692c1d75a9e1046a Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Mon, 18 Oct 2004 19:29:13 +0000 Subject: [PATCH] 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. --- sys/dev/random/harvest.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/random/harvest.c b/sys/dev/random/harvest.c index 0ffa83eff03..d78306524ff 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,