diff options
author | markm <markm@FreeBSD.org> | 1995-12-28 17:09:14 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1995-12-28 17:09:14 +0000 |
commit | 759619ec439169e549362058354a92a7f5f13e80 (patch) | |
tree | 81776de85ad235c266315c093075619ca6191f1c /sys | |
parent | a1a68e9a51e2ba172fb998a1ed5b577b8b6c2673 (diff) | |
download | FreeBSD-src-759619ec439169e549362058354a92a7f5f13e80.zip FreeBSD-src-759619ec439169e549362058354a92a7f5f13e80.tar.gz |
1) Add #include <machine/cpu.h> to catch some 586 #defines
2) swap the 2 arguments to outb (kato)
Pointed out by: Kato Takenori <kato@eclogite.eps.nagoya-u.ac.jp>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/isa/random_machdep.c | 5 | ||||
-rw-r--r-- | sys/kern/kern_random.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/i386/isa/random_machdep.c b/sys/i386/isa/random_machdep.c index 3616585..c62db13 100644 --- a/sys/i386/isa/random_machdep.c +++ b/sys/i386/isa/random_machdep.c @@ -1,7 +1,7 @@ /* * random.c -- A strong random number generator * - * $Id$ + * $Id: random_machdep.c,v 1.2 1995/12/27 11:22:01 markm Exp $ * * Version 0.95, last modified 18-Oct-95 * @@ -49,6 +49,7 @@ #include <i386/isa/isa.h> #include <i386/isa/timerreg.h> #include <i386/isa/isa_device.h> +#include <machine/cpu.h> #include <machine/random.h> /* @@ -191,7 +192,7 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state, } else { #endif - outb(TIMER_LATCH|TIMER_SEL0, TIMER_MODE); /* latch ASAP */ + outb(TIMER_MODE, TIMER_LATCH|TIMER_SEL0); /* latch ASAP */ num ^= inb(TIMER_CNTR0) << 16; num ^= inb(TIMER_CNTR0) << 24; r->entropy_count += 2; diff --git a/sys/kern/kern_random.c b/sys/kern/kern_random.c index 3616585..c62db13 100644 --- a/sys/kern/kern_random.c +++ b/sys/kern/kern_random.c @@ -1,7 +1,7 @@ /* * random.c -- A strong random number generator * - * $Id$ + * $Id: random_machdep.c,v 1.2 1995/12/27 11:22:01 markm Exp $ * * Version 0.95, last modified 18-Oct-95 * @@ -49,6 +49,7 @@ #include <i386/isa/isa.h> #include <i386/isa/timerreg.h> #include <i386/isa/isa_device.h> +#include <machine/cpu.h> #include <machine/random.h> /* @@ -191,7 +192,7 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state, } else { #endif - outb(TIMER_LATCH|TIMER_SEL0, TIMER_MODE); /* latch ASAP */ + outb(TIMER_MODE, TIMER_LATCH|TIMER_SEL0); /* latch ASAP */ num ^= inb(TIMER_CNTR0) << 16; num ^= inb(TIMER_CNTR0) << 24; r->entropy_count += 2; |