Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Oct 2013 12:35:29 +0000 (UTC)
From:      Mark Murray <markm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r256084 - projects/random_number_generator/sys/dev/random
Message-ID:  <201310061235.r96CZTIv031694@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markm
Date: Sun Oct  6 12:35:29 2013
New Revision: 256084
URL: http://svnweb.freebsd.org/changeset/base/256084

Log:
  Don't use the "real" assembler mnemonics; older compilers may not
  understand them (like when building CURRENT on 9.x).
  
  Submitted by:	Konstantin Belousov <kostikbel@gmail.com>

Modified:
  projects/random_number_generator/sys/dev/random/ivy.c
  projects/random_number_generator/sys/dev/random/nehemiah.c

Modified: projects/random_number_generator/sys/dev/random/ivy.c
==============================================================================
--- projects/random_number_generator/sys/dev/random/ivy.c	Sun Oct  6 12:31:24 2013	(r256083)
+++ projects/random_number_generator/sys/dev/random/ivy.c	Sun Oct  6 12:35:29 2013	(r256084)
@@ -65,12 +65,12 @@ ivy_rng_store(uint64_t *tmp)
 
 	__asm __volatile(
 #ifdef __amd64__
-	    "rdrand\t%%rax\n\t"
+	    ".byte\t0x48,0x0f,0xc7,0xf0\n\t" /* rdrand %rax */
 	    "jnc\t1f\n\t"
 	    "movq\t%%rax,%1\n\t"
 	    "movl\t$8,%%eax\n"
 #else /* i386 */
-	    "rdrand\t%%eax\n\t"
+	    ".byte\t0x0f,0xc7,0xf0\n\t" /* rdrand %eax */
 	    "jnc\t1f\n\t"
 	    "movl\t%%eax,%1\n\t"
 	    "movl\t$4,%%eax\n"

Modified: projects/random_number_generator/sys/dev/random/nehemiah.c
==============================================================================
--- projects/random_number_generator/sys/dev/random/nehemiah.c	Sun Oct  6 12:31:24 2013	(r256083)
+++ projects/random_number_generator/sys/dev/random/nehemiah.c	Sun Oct  6 12:35:29 2013	(r256084)
@@ -71,7 +71,7 @@ VIA_RNG_store(void *buf)
 #ifdef __GNUCLIKE_ASM
 	__asm __volatile(
 		"movl	$0,%%edx\n\t"
-		"xstore"
+		".byte	0x0f, 0xa7, 0xc0" /* xstore */
 			: "=a" (retval), "+d" (rate), "+D" (buf)
 			:
 			: "memory"



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