diff options
author | bde <bde@FreeBSD.org> | 1996-04-07 18:16:26 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-04-07 18:16:26 +0000 |
commit | b4a0a5c2e577225c475b40df1abbcb05c310a467 (patch) | |
tree | 6db08b829ead756b77fab645a6d197591cc89acf /sys/i386/isa/random_machdep.c | |
parent | 82c211f290bc616a79e86e1d039e7054ec44f7e5 (diff) | |
download | FreeBSD-src-b4a0a5c2e577225c475b40df1abbcb05c310a467.zip FreeBSD-src-b4a0a5c2e577225c475b40df1abbcb05c310a467.tar.gz |
Use rdtsc() function instead of inline essembler.
Diffstat (limited to 'sys/i386/isa/random_machdep.c')
-rw-r--r-- | sys/i386/isa/random_machdep.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/i386/isa/random_machdep.c b/sys/i386/isa/random_machdep.c index 39fdf6f..46ab680 100644 --- a/sys/i386/isa/random_machdep.c +++ b/sys/i386/isa/random_machdep.c @@ -1,7 +1,7 @@ /* * random_machdep.c -- A strong random number generator * - * $Id: random_machdep.c,v 1.4 1995/12/29 08:04:32 markm Exp $ + * $Id: random_machdep.c,v 1.5 1996/04/07 17:38:39 bde Exp $ * * Version 0.95, last modified 18-Oct-95 * @@ -181,11 +181,7 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state, #if defined(I586_CPU) || defined(I686_CPU) if (i586_ctr_rate != 0) { - u_long low, high; - - /* RDTSC. */ - __asm __volatile(".byte 0x0f,0x31" :"=a" (low), "=d" (high)); - num ^= low << 16; + num ^= (u_int32_t) rdtsc() << 16; r->entropy_count += 2; } else { #endif |