Module Name: src Committed By: riastradh Date: Tue Apr 14 13:26:59 UTC 2015
Modified Files: src/sys/kern: kern_rndq.c Log Message: Group initialization of rnd_samples and rnd_global. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/kern/kern_rndq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_rndq.c diff -u src/sys/kern/kern_rndq.c:1.58 src/sys/kern/kern_rndq.c:1.59 --- src/sys/kern/kern_rndq.c:1.58 Tue Apr 14 13:23:25 2015 +++ src/sys/kern/kern_rndq.c Tue Apr 14 13:26:58 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_rndq.c,v 1.58 2015/04/14 13:23:25 riastradh Exp $ */ +/* $NetBSD: kern_rndq.c,v 1.59 2015/04/14 13:26:58 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.58 2015/04/14 13:23:25 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_rndq.c,v 1.59 2015/04/14 13:26:58 riastradh Exp $"); #include <sys/param.h> #include <sys/atomic.h> @@ -495,20 +495,22 @@ rnd_init(void) if (rnd_ready) return; - mutex_init(&rnd_samples.lock, MUTEX_DEFAULT, IPL_VM); - rndsinks_init(); - /* * take a counter early, hoping that there's some variance in * the following operations */ c = rnd_counter(); - LIST_INIT(&rnd_global.sources); + rndsinks_init(); + + /* Initialize the sample queue. */ + mutex_init(&rnd_samples.lock, MUTEX_DEFAULT, IPL_VM); SIMPLEQ_INIT(&rnd_samples.q); - rndpool_init(&rnd_global.pool); + /* Initialize the global pool and sources list. */ mutex_init(&rnd_global.lock, MUTEX_DEFAULT, IPL_VM); + rndpool_init(&rnd_global.pool); + LIST_INIT(&rnd_global.sources); rnd_mempc = pool_cache_init(sizeof(rnd_sample_t), 0, 0, 0, "rndsample", NULL, IPL_VM,