Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Tighten initialization of rnd softints.



details:   https://anonhg.NetBSD.org/src/rev/1c4b9bbed076
branches:  trunk
changeset: 789624:1c4b9bbed076
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 28 12:50:18 2013 +0000

description:
Tighten initialization of rnd softints.

- Do rnd_init_softint as early as possible in main, after configure2,
  and before networking is initialized.

- Initialize the rnd_wakeup softint in rnd_init_softint, not lazily in
  rnd_schedule_wakeup.

ok tls

diffstat:

 sys/kern/init_main.c |   9 +++++----
 sys/kern/kern_rndq.c |  10 ++++------
 2 files changed, 9 insertions(+), 10 deletions(-)

diffs (75 lines):

diff -r 36c7ab27158a -r 1c4b9bbed076 sys/kern/init_main.c
--- a/sys/kern/init_main.c      Wed Aug 28 08:05:21 2013 +0000
+++ b/sys/kern/init_main.c      Wed Aug 28 12:50:18 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_main.c,v 1.452 2013/08/27 19:30:10 riastradh Exp $        */
+/*     $NetBSD: init_main.c,v 1.453 2013/08/28 12:50:18 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.452 2013/08/27 19:30:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.453 2013/08/28 12:50:18 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ipsec.h"
@@ -519,6 +519,9 @@
        /* Now timer is working.  Enable preemption. */
        kpreempt_enable();
 
+       /* Enable deferred processing of RNG samples */
+       rnd_init_softint();
+
 #ifdef SYSVSHM
        /* Initialize System V style shared memory. */
        shminit();
@@ -565,8 +568,6 @@
        if_attachdomain();
        splx(s);
 
-       rnd_init_softint();
-
 #ifdef GPROF
        /* Initialize kernel profiling. */
        kmstartup();
diff -r 36c7ab27158a -r 1c4b9bbed076 sys/kern/kern_rndq.c
--- a/sys/kern/kern_rndq.c      Wed Aug 28 08:05:21 2013 +0000
+++ b/sys/kern/kern_rndq.c      Wed Aug 28 12:50:18 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_rndq.c,v 1.18 2013/08/27 19:30:10 riastradh Exp $ */
+/*     $NetBSD: kern_rndq.c,v 1.19 2013/08/28 12:50:18 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.18 2013/08/27 19:30:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.19 2013/08/28 12:50:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -168,6 +168,8 @@
 rnd_init_softint(void) {
        rnd_process = softint_establish(SOFTINT_SERIAL|SOFTINT_MPSAFE,
            rnd_intr, NULL);
+       rnd_wakeup = softint_establish(SOFTINT_CLOCK|SOFTINT_MPSAFE,
+           rnd_wake, NULL);
 }
 
 /*
@@ -220,10 +222,6 @@
                rnd_schedule_softint(rnd_wakeup);
                return;
        }
-       if (!cold) {
-               rnd_wakeup = softint_establish(SOFTINT_CLOCK|SOFTINT_MPSAFE,
-                                              rnd_wake, NULL);
-       }
        rnd_wakeup_readers();
 }
 



Home | Main Index | Thread Index | Old Index