Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Nov 2014 20:12:24 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Konstantin Belousov <kib@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r274250 - head/sys/dev/random
Message-ID:  <2BDD3161-15BE-43FF-95CB-7DC6D01DAA58@FreeBSD.org>
In-Reply-To: <201411072010.sA7KAAkp026433@svn.freebsd.org>
References:  <201411072010.sA7KAAkp026433@svn.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On 07 Nov 2014, at 21:10, Konstantin Belousov <kib@FreeBSD.org> wrote:
> 
> Author: kib
> Date: Fri Nov  7 20:10:09 2014
> New Revision: 274250
> URL: https://svnweb.freebsd.org/changeset/base/274250
> 
> Log:
>  Simplify assembler in ivy.c.  Move the copying of the random bits into
>  buffer from asm to C, which reduces amount of arguments for inline asm
>  and simplifies constraints.  Use unsigned types consistently.
> 
>  Submitted by:	bde
>  Approved by:	secteam (delphij)
>  Reviewed by:	markm
>  MFC after:	1 week
> 
> Modified:
>  head/sys/dev/random/ivy.c
> 
> Modified: head/sys/dev/random/ivy.c
> ==============================================================================
> --- head/sys/dev/random/ivy.c	Fri Nov  7 19:34:10 2014	(r274249)
> +++ head/sys/dev/random/ivy.c	Fri Nov  7 20:10:09 2014	(r274250)
> @@ -61,42 +61,41 @@ static struct live_entropy_source random
> };
> 
> static inline int
> -ivy_rng_store(long *buf)
> +ivy_rng_store(u_long *buf)
> {
> #ifdef __GNUCLIKE_ASM
> -	long tmp;
> +	u_long rndval;
> 	int retry;
> 
> 	retry = RETRY_COUNT;
> 	__asm __volatile(
> 	    "1:\n\t"
> -	    "rdrand	%2\n\t"	/* read randomness into tmp */
> -	    "jb		2f\n\t" /* CF is set on success, exit retry loop */
> +	    "rdrand	%1\n\t"	/* read randomness into tmp */
> +	    "jc		2f\n\t" /* CF is set on success, exit retry loop */

You might want to update the first comment to "read randomness into
rndval", for consistency.

-Dimitry


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.26

iEYEARECAAYFAlRhDh0ACgkQsF6jCi4glqMzoACfX+b7r5HXj+5MV6XQIV5zG2E/
TbcAni1wvBIUgO3ptDNDliKhE1sc4NC8
=OgKx
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2BDD3161-15BE-43FF-95CB-7DC6D01DAA58>