diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-01-05 11:09:04 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1997-01-05 11:09:04 +0000 |
commit | d477b56cac6c81b3c26380477da5f767bfc7cc7e (patch) | |
tree | 8d6a347fbe1602aeed5b39043708cda50901c247 /sys/kern | |
parent | 3afc301960a4fcf28a198f9f4d1d327a0837f83b (diff) |
Remove lots of timer_state structs as they just ate memory and only a few was
ever used. Now a single state is kept for net, tty and disk events resp.
Also, call the randomness from disk_unbusy instead of biodone, as biodone
gets a lot of virtual events (from virtual filesystems etc), and as a bonus:
feed xfer time and size into the entropy pool too.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_disk.c | 4 | ||||
-rw-r--r-- | sys/kern/tty.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_bio.c | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 960f4f6d715..6caec0043fe 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -56,6 +56,8 @@ #include <sys/dkio.h> #include <sys/dkstat.h> /* XXX */ +#include <dev/rndvar.h> + /* * A global list of all disks attached to the system. May grow or * shrink over time. @@ -390,6 +392,8 @@ disk_unbusy(diskp, bcount) diskp->dk_xfer++; } diskp->dk_seek++; + + add_disk_randomness(bcount ^ diff_time.tv_usec); } /* diff --git a/sys/kern/tty.c b/sys/kern/tty.c index d3c8cf260ad..1dbbcdccaad 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.24 1996/12/19 07:54:06 tholo Exp $ */ +/* $OpenBSD: tty.c,v 1.25 1997/01/05 11:09:02 niklas Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -237,7 +237,7 @@ ttyinput(c, tp) register u_char *cc; int i, error; - add_tty_randomness(tp->t_dev, c); + add_tty_randomness(tp->t_dev << 8 | c); /* * If receiver is not enable, drop it. */ diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index ed178589786..33ad1cad470 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.12 1996/10/19 13:26:02 mickey Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.13 1997/01/05 11:09:01 niklas Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /*- @@ -62,7 +62,6 @@ #include <sys/kernel.h> #include <vm/vm.h> -#include <dev/rndvar.h> /* Macros to clear/set/test flags. */ #define SET(t, f) (t) |= (f) @@ -960,8 +959,6 @@ biodone(bp) panic("biodone already"); SET(bp->b_flags, B_DONE); /* note that it's done */ - add_blkdev_randomness(bp->b_dev); /* grow universe entropy */ - if (!ISSET(bp->b_flags, B_READ)) /* wake up reader */ vwakeup(bp); |