summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>1996-03-29 12:05:34 +0000
committermickey <mickey@openbsd.org>1996-03-29 12:05:34 +0000
commitf988debc44f8bc212950405ab86940e90b25e8d7 (patch)
treefbdb189f01090fcc18c3557d61a8b045ec3af69c /sys/kern
parentFrom NetBSD: merge of 960317 (diff)
downloadwireguard-openbsd-f988debc44f8bc212950405ab86940e90b25e8d7.tar.xz
wireguard-openbsd-f988debc44f8bc212950405ab86940e90b25e8d7.zip
Initial commit of random source driver.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 0667f8ed409..1db9d352799 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -60,6 +60,11 @@
#include <sys/conf.h>
#include <sys/cpu.h>
+#include "rnd.h"
+#if NRND > 0
+#include <dev/rndvar.h>
+#endif
+
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
@@ -790,6 +795,10 @@ biodone(bp)
panic("biodone already");
SET(bp->b_flags, B_DONE); /* note that it's done */
+#if NRND > 0
+ add_blkdev_randomness(bp->b_dev);
+#endif
+
if (!ISSET(bp->b_flags, B_READ)) /* wake up reader */
vwakeup(bp);