summaryrefslogtreecommitdiff
path: root/sys/dev/randomdev/harvest.c
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2000-09-10 13:52:19 +0000
committerMark Murray <markm@FreeBSD.org>2000-09-10 13:52:19 +0000
commit4d87a031c0106945da094f3ea770ea9b4b5fcd6b (patch)
tree2484438b84cf978fc9d6bb05b65b287e622df1ec /sys/dev/randomdev/harvest.c
parent9714dd1a3ab065c037da5000ca1e429cdccea7ae (diff)
Notes
Diffstat (limited to 'sys/dev/randomdev/harvest.c')
-rw-r--r--sys/dev/randomdev/harvest.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/randomdev/harvest.c b/sys/dev/randomdev/harvest.c
index 92de3185b7fd..a1abaa9dfdf4 100644
--- a/sys/dev/randomdev/harvest.c
+++ b/sys/dev/randomdev/harvest.c
@@ -30,6 +30,7 @@
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/queue.h>
+#include <sys/kthread.h>
#include <sys/linker.h>
#include <sys/libkern.h>
#include <sys/mbuf.h>
@@ -37,6 +38,7 @@
#include <sys/time.h>
#include <crypto/blowfish/blowfish.h>
+#include <dev/randomdev/hash.h>
#include <dev/randomdev/yarrow.h>
/* hold the address of the routine which is actually called if
@@ -73,3 +75,20 @@ random_harvest(void *entropy, u_int count, u_int bits, u_int frac, u_int origin)
(*reap)(&timebuf, entropy, count, bits, frac, origin);
}
}
+
+/* Helper routines to enable kthread_exit() to work while the module is
+ * being (or has been) unloaded.
+ */
+void
+random_set_wakeup(int *var, int value)
+{
+ *var = value;
+ wakeup(var);
+}
+
+void
+random_set_wakeup_exit(int *var, int value, int exitval)
+{
+ random_set_wakeup(var, value);
+ kthread_exit(exitval);
+}