summaryrefslogtreecommitdiffstats
path: root/sys/dev/random
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2009-05-25 22:50:11 +0000
committermarkm <markm@FreeBSD.org>2009-05-25 22:50:11 +0000
commit1dd056c920c6324a6109f85f65050b2987bcc980 (patch)
tree6e3646fa4242a60ce3795113d0a7e552d8a65ea3 /sys/dev/random
parent224d86596e587e219667440afc02a32e1cbff07e (diff)
downloadFreeBSD-src-1dd056c920c6324a6109f85f65050b2987bcc980.zip
FreeBSD-src-1dd056c920c6324a6109f85f65050b2987bcc980.tar.gz
There is rubbish here
It is time to take it out Now it is cleaner
Diffstat (limited to 'sys/dev/random')
-rw-r--r--sys/dev/random/nehemiah.c2
-rw-r--r--sys/dev/random/randomdev_soft.c17
2 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/random/nehemiah.c b/sys/dev/random/nehemiah.c
index 3001b20..e34cdfa 100644
--- a/sys/dev/random/nehemiah.c
+++ b/sys/dev/random/nehemiah.c
@@ -129,7 +129,7 @@ random_nehemiah_init(void)
{
acw.raw = 0ULL;
acw.field.round_count = 12;
-
+
mtx_init(&random_nehemiah_mtx, "random nehemiah", NULL, MTX_DEF);
}
diff --git a/sys/dev/random/randomdev_soft.c b/sys/dev/random/randomdev_soft.c
index dfe589a..cef64ab 100644
--- a/sys/dev/random/randomdev_soft.c
+++ b/sys/dev/random/randomdev_soft.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2000-2004 Mark R V Murray
+ * Copyright (c) 2000-2009 Mark R V Murray
* Copyright (c) 2004 Robert N. M. Watson
* All rights reserved.
*
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#define RANDOM_FIFO_MAX 256 /* How many events to queue up */
static void random_kthread(void *);
-static void
+static void
random_harvest_internal(u_int64_t, const void *, u_int,
u_int, u_int, enum esource);
static int random_yarrow_poll(int event,struct thread *td);
@@ -235,7 +235,7 @@ random_kthread(void *arg __unused)
{
STAILQ_HEAD(, harvest) local_queue;
struct harvest *event = NULL;
- int active, local_count;
+ int local_count;
enum esource source;
STAILQ_INIT(&local_queue);
@@ -244,8 +244,6 @@ random_kthread(void *arg __unused)
/* Process until told to stop */
for (; random_kthread_control >= 0;) {
- active = 0;
-
/* Cycle through all the entropy sources */
mtx_lock_spin(&harvest_mtx);
for (source = RANDOM_START; source < ENTROPYSOURCE; source++) {
@@ -284,9 +282,8 @@ random_kthread(void *arg __unused)
if (random_kthread_control == 1)
random_kthread_control = 0;
- /* Found nothing, so don't belabour the issue */
- if (!active)
- pause("-", hz / 10);
+ /* Work done, so don't belabour the issue */
+ pause("-", hz / 10);
}
@@ -381,7 +378,7 @@ random_yarrow_poll(int events, struct thread *td)
revents = events & (POLLIN | POLLRDNORM);
else
selrecord(td, &random_systat.rsel);
-
+
mtx_unlock(&random_reseed_mtx);
return revents;
}
@@ -407,7 +404,7 @@ random_yarrow_block(int flag)
mtx_unlock(&random_reseed_mtx);
return error;
-}
+}
/* Helper routine to perform explicit reseeds */
static void
OpenPOWER on IntegriCloud