diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index e233c7d83f7a..e4f3b2ff05c5 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_main.c,v 1.449 2013/06/05 19:01:26 christos Exp $ */ +/* $NetBSD: init_main.c,v 1.450 2013/06/20 23:21:41 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.449 2013/06/05 19:01:26 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.450 2013/06/20 23:21:41 christos Exp $"); #include "opt_ddb.h" #include "opt_ipsec.h" @@ -565,6 +565,8 @@ main(void) if_attachdomain(); splx(s); + rnd_init_softint(); + #ifdef GPROF /* Initialize kernel profiling. */ kmstartup(); diff --git a/sys/kern/kern_rndq.c b/sys/kern/kern_rndq.c index 0497aa89fa7c..9ef36977865d 100644 --- a/sys/kern/kern_rndq.c +++ b/sys/kern/kern_rndq.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $ */ +/* $NetBSD: kern_rndq.c,v 1.13 2013/06/20 23:21:41 christos Exp $ */ /*- * Copyright (c) 1997-2013 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.12 2013/06/13 01:37:03 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.13 2013/06/20 23:21:41 christos Exp $"); #include #include @@ -174,6 +174,12 @@ LIST_HEAD(, krndsource) rnd_sources; rndsave_t *boot_rsp; +void +rnd_init_softint(void) { + rnd_process = softint_establish(SOFTINT_SERIAL|SOFTINT_MPSAFE, + rnd_intr, NULL); +} + /* * Generate a 32-bit counter. This should be more machine dependent, * using cycle counters and the like when possible. @@ -207,20 +213,12 @@ rnd_schedule_softint(void *softint) kpreempt_enable(); } -/* - * XXX repulsive: we can't initialize our softints in rnd_init - * XXX (too early) so we wrap the points where we'd schedule them, thus. - */ static inline void rnd_schedule_process(void) { if (__predict_true(rnd_process)) { rnd_schedule_softint(rnd_process); return; - } - if (!cold) { - rnd_process = softint_establish(SOFTINT_SERIAL|SOFTINT_MPSAFE, - rnd_intr, NULL); } rnd_process_events(); } diff --git a/sys/sys/rnd.h b/sys/sys/rnd.h index cfab0af479ca..9eb875a903fd 100644 --- a/sys/sys/rnd.h +++ b/sys/sys/rnd.h @@ -1,4 +1,4 @@ -/* $NetBSD: rnd.h,v 1.36 2013/06/13 00:55:01 tls Exp $ */ +/* $NetBSD: rnd.h,v 1.37 2013/06/20 23:21:42 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -176,6 +176,7 @@ uint32_t rndpool_get_poolsize(void); void rndpool_add_data(rndpool_t *, void *, uint32_t, uint32_t); uint32_t rndpool_extract_data(rndpool_t *, void *, uint32_t, uint32_t); void rnd_init(void); +void rnd_init_softint(void); void _rnd_add_uint32(krndsource_t *, uint32_t); void rnd_add_data(krndsource_t *, const void *const, uint32_t, uint32_t);