Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Feb 2014 15:01:09 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Mark Murray <markm@FreeBSD.org>
Cc:        svn-src-projects@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r262380 - projects/random_number_generator/sys/dev/random
Message-ID:  <20140224110109.GO86937@FreeBSD.org>
In-Reply-To: <201402231849.s1NInrvj073433@svn.freebsd.org>
References:  <201402231849.s1NInrvj073433@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140224110109.GO86937>