diff options
author | markm <markm@FreeBSD.org> | 2003-11-17 23:02:21 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2003-11-17 23:02:21 +0000 |
commit | f9c943515638ad456438656dd3d79e6896d4089d (patch) | |
tree | 3d031ff4aa808b1f35307d1c7c1e8da496ee119c /sys/dev/random/harvest.c | |
parent | cc012e083576d0a4a3c5362245a17f627fbe19c4 (diff) | |
download | FreeBSD-src-f9c943515638ad456438656dd3d79e6896d4089d.zip FreeBSD-src-f9c943515638ad456438656dd3d79e6896d4089d.tar.gz |
Overhaul the entropy device:
o Each source gets its own queue, which is a FIFO, not a ring buffer.
The FIFOs are implemented with the sys/queue.h macros. The separation
is so that a low entropy/high rate source can't swamp the harvester
with low-grade entropy and destroy the reseeds.
o Each FIFO is limited to 256 (set as a macro, so adjustable) events
queueable. Full FIFOs are ignored by the harvester. This is to
prevent memory wastage, and helps to keep the kernel thread CPU
usage within reasonable limits.
o There is no need to break up the event harvesting into ${burst}
sized chunks, so retire that feature.
o Break the device away from its roots with the memory device, and
allow it to get its major number automagically.
Diffstat (limited to 'sys/dev/random/harvest.c')
-rw-r--r-- | sys/dev/random/harvest.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/random/harvest.c b/sys/dev/random/harvest.c index b73450d..fd94bd2 100644 --- a/sys/dev/random/harvest.c +++ b/sys/dev/random/harvest.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000 Mark R V Murray + * Copyright (c) 2000, 2001, 2002, 2003 Mark R V Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,16 +29,16 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> -#include <sys/systm.h> -#include <sys/types.h> -#include <sys/queue.h> #include <sys/kthread.h> #include <sys/lock.h> +#include <sys/malloc.h> #include <sys/mutex.h> #include <sys/poll.h> +#include <sys/queue.h> +#include <sys/random.h> #include <sys/selinfo.h> #include <sys/sysctl.h> -#include <sys/random.h> +#include <sys/systm.h> #include <machine/cpu.h> |