svn commit: r262380 - projects/random_number_generator/sys/dev/random

Gleb Smirnoff glebius at FreeBSD.org
Mon Feb 24 11:01:19 UTC 2014


  Mark,

On Sun, Feb 23, 2014 at 06:49:53PM +0000, Mark Murray wrote:
M> Author: markm
M> Date: Sun Feb 23 18:49:52 2014
M> New Revision: 262380
M> URL: http://svnweb.freebsd.org/changeset/base/262380
M> 
M> Log:
M>   Remove STAILQ manipulations from the harvest path. This will be a lot more friendly to the critical bits of the kernel.
...
M> +/*
M> + * Lockable FIFO ring buffer holding entropy events
M> + * If ring_in == ring_out,
M> + *     the buffer is empty.
M> + * If (ring_in + 1) == ring_out (MOD RANDOM_FIFO_MAX),
M> + *     the buffer is full.
M> + */
M> +static struct entropyfifo {
M> +	struct harvest_event ring[RANDOM_FIFO_MAX];
M> +	volatile u_int ring_in;
M> +	volatile u_int ring_out;
M> +} entropyfifo;

Would buf_ring(9) do the job? If not, may be it is worth to bring it to a state
that would suffice your needs, instead of making another implementation?

-- 
Totus tuus, Glebius.


More information about the svn-src-projects mailing list