mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
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>
This commit is contained in:
parent
4c19ddc5f1
commit
179c10f92d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13080
2 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue