Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/arch/hp300/dev Pullup 1.41 [he]:



details:   https://anonhg.NetBSD.org/src/rev/f4881a0210bd
branches:  netbsd-1-5
changeset: 489844:f4881a0210bd
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Oct 18 00:10:15 2000 +0000

description:
Pullup 1.41 [he]:
Add randomness sampling from hil, sd and rd devices.

diffstat:

 sys/arch/hp300/dev/hil.c |  21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diffs (56 lines):

diff -r 019814affb3c -r f4881a0210bd sys/arch/hp300/dev/hil.c
--- a/sys/arch/hp300/dev/hil.c  Tue Oct 17 23:46:51 2000 +0000
+++ b/sys/arch/hp300/dev/hil.c  Wed Oct 18 00:10:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hil.c,v 1.39.4.1 2000/06/30 16:27:23 simonb Exp $      */
+/*     $NetBSD: hil.c,v 1.39.4.2 2000/10/18 00:10:15 tv Exp $  */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -43,6 +43,7 @@
  */
 
 #include "opt_compat_hpux.h"
+#include "rnd.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,6 +58,10 @@
 #include <sys/uio.h>
 #include <sys/user.h>
 
+#if NRND > 0
+#include <sys/rnd.h>
+#endif
+
 #include <hp300/dev/hilreg.h>
 #include <hp300/dev/hilioctl.h>
 #include <hp300/dev/hilvar.h>
@@ -825,6 +830,9 @@
        stat = READHILSTAT(hildevice);
        c = READHILDATA(hildevice);             /* clears interrupt */
        hil_process_int(hilp, stat, c);
+#if NRND > 0
+       rnd_add_uint32(&hilp->rnd_source, (stat<<8)|c);
+#endif
 }
 
 #include "ite.h"
@@ -1338,6 +1346,17 @@
                        printf(" 0");
                printf("\n");
        }
+#if NRND > 0
+       /*
+        * attach the device into the random source list
+        * except from ID module (no point)
+        */
+       if (!id) {
+               char buf[10];
+               sprintf(buf, "hil%d", unit);
+               rnd_attach_source(&hilp->rnd_source, buf, RND_TYPE_TTY, 0);
+       }
+#endif
 }
 
 #define HILAR1 0x3E



Home | Main Index | Thread Index | Old Index