Subject: /dev/random cleanup [sommerfeld@netbsd.org: CVS commit: syssrc]
To: None <sommerfeld@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: source-changes
Date: 06/06/2000 10:48:15
Bill Sommerfeld wrote:
> Module Name: syssrc
> Committed By: sommerfeld
> Date: Mon Jun 5 23:42:35 UTC 2000
>
> Modified Files:
>
> syssrc/sys/dev: rnd.c rndpool.c
> syssrc/sys/sys: rnd.h
>
> Log Message:
>
> /dev/random code cleanups:
> [ ... ]
> - allow MD code to supply cpu_timestamp() and cpu_havetimestamp() for
> an optional higher-resolution clock/roulette wheel source.
One questions - would be be better to store the results of the test
+#ifdef __HAVE_CPU_TIMESTAMP
+ if (cpu_hastimestamp())
+ return cpu_timestamp();
+#endif
in a static variable? I notice that the test is both inline and
inexpensive on the i386 example, but this may not be on other platforms.
Hmm, or maybe make cpu_hastimestamp() a stub call on platforms where
this test would be expensive and leave this fragment as is...
Simon.