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
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* random.c -- A strong random number generator
|
* 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
|
* Version 0.95, last modified 18-Oct-95
|
||||||
*
|
*
|
||||||
@ -49,6 +49,7 @@
|
|||||||
#include <i386/isa/isa.h>
|
#include <i386/isa/isa.h>
|
||||||
#include <i386/isa/timerreg.h>
|
#include <i386/isa/timerreg.h>
|
||||||
#include <i386/isa/isa_device.h>
|
#include <i386/isa/isa_device.h>
|
||||||
|
#include <machine/cpu.h>
|
||||||
#include <machine/random.h>
|
#include <machine/random.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -191,7 +192,7 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif
|
#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) << 16;
|
||||||
num ^= inb(TIMER_CNTR0) << 24;
|
num ^= inb(TIMER_CNTR0) << 24;
|
||||||
r->entropy_count += 2;
|
r->entropy_count += 2;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* random.c -- A strong random number generator
|
* 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
|
* Version 0.95, last modified 18-Oct-95
|
||||||
*
|
*
|
||||||
@ -49,6 +49,7 @@
|
|||||||
#include <i386/isa/isa.h>
|
#include <i386/isa/isa.h>
|
||||||
#include <i386/isa/timerreg.h>
|
#include <i386/isa/timerreg.h>
|
||||||
#include <i386/isa/isa_device.h>
|
#include <i386/isa/isa_device.h>
|
||||||
|
#include <machine/cpu.h>
|
||||||
#include <machine/random.h>
|
#include <machine/random.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -191,7 +192,7 @@ add_timer_randomness(struct random_bucket *r, struct timer_rand_state *state,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#endif
|
#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) << 16;
|
||||||
num ^= inb(TIMER_CNTR0) << 24;
|
num ^= inb(TIMER_CNTR0) << 24;
|
||||||
r->entropy_count += 2;
|
r->entropy_count += 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user