Module Name:    src
Committed By:   riastradh
Date:           Sat Mar 19 14:35:08 UTC 2022

Modified Files:
        src/sys/kern: kern_entropy.c
        src/sys/sys: rnd.h

Log Message:
rnd(9): Delete legacy rnd_initial_entropy symbol.

Use entropy_epoch() instead.

XXX kernel ABI change deleting symbol requires bump


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/kern/kern_entropy.c
cvs rdiff -u -r1.49 -r1.50 src/sys/sys/rnd.h

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_entropy.c
diff -u src/sys/kern/kern_entropy.c:1.40 src/sys/kern/kern_entropy.c:1.41
--- src/sys/kern/kern_entropy.c:1.40	Fri Mar 18 23:35:28 2022
+++ src/sys/kern/kern_entropy.c	Sat Mar 19 14:35:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_entropy.c,v 1.40 2022/03/18 23:35:28 riastradh Exp $	*/
+/*	$NetBSD: kern_entropy.c,v 1.41 2022/03/19 14:35:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.40 2022/03/18 23:35:28 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.41 2022/03/19 14:35:08 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -193,8 +193,6 @@ static struct percpu	*entropy_percpu __r
 static void		*entropy_sih __read_mostly; /* softint handler */
 static struct lwp	*entropy_lwp __read_mostly; /* housekeeping thread */
 
-int rnd_initial_entropy __read_mostly; /* XXX legacy */
-
 static struct krndsource seed_rndsource __read_mostly;
 
 /*
@@ -1165,10 +1163,8 @@ entropy_notify(void)
 	 * that we're ready so operators can compare it to the timing
 	 * of other events.
 	 */
-	if (__predict_false(!rnd_initial_entropy) && E->needed == 0) {
+	if (__predict_false(E->epoch == (unsigned)-1) && E->needed == 0)
 		printf("entropy: ready\n");
-		rnd_initial_entropy = 1;
-	}
 
 	/* Set the epoch; roll over from UINTMAX-1 to 1.  */
 	if (__predict_true(!atomic_load_relaxed(&entropy_depletion)) ||
@@ -1178,6 +1174,7 @@ entropy_notify(void)
 			epoch = 1;
 		atomic_store_relaxed(&E->epoch, epoch);
 	}
+	KASSERT(E->epoch != (unsigned)-1);
 
 	/* Notify waiters.  */
 	if (E->stage >= ENTROPY_WARM) {

Index: src/sys/sys/rnd.h
diff -u src/sys/sys/rnd.h:1.49 src/sys/sys/rnd.h:1.50
--- src/sys/sys/rnd.h:1.49	Tue Apr 14 12:51:30 2015
+++ src/sys/sys/rnd.h	Sat Mar 19 14:35:08 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.h,v 1.49 2015/04/14 12:51:30 riastradh Exp $	*/
+/*	$NetBSD: rnd.h,v 1.50 2022/03/19 14:35:08 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -47,8 +47,6 @@ void		rnd_init_softint(void);
 void		rnd_seed(void *, size_t);
 int		rnd_system_ioctl(struct file *, u_long, void *);
 
-extern int	rnd_initial_entropy;
-
 #endif /* _KERNEL */
 
 #endif /* !_SYS_RND_H_ */

Reply via email to