Source-Changes-HG archive

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

[src/trunk]: src/sys rnd(9): Delete legacy rnd_initial_entropy symbol.



details:   https://anonhg.NetBSD.org/src/rev/f499d983bf25
branches:  trunk
changeset: 364374:f499d983bf25
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Mar 19 14:35:08 2022 +0000

description:
rnd(9): Delete legacy rnd_initial_entropy symbol.

Use entropy_epoch() instead.

XXX kernel ABI change deleting symbol requires bump

diffstat:

 sys/kern/kern_entropy.c |  11 ++++-------
 sys/sys/rnd.h           |   4 +---
 2 files changed, 5 insertions(+), 10 deletions(-)

diffs (65 lines):

diff -r 0c4f07216f3b -r f499d983bf25 sys/kern/kern_entropy.c
--- a/sys/kern/kern_entropy.c   Sat Mar 19 14:34:47 2022 +0000
+++ b/sys/kern/kern_entropy.c   Sat Mar 19 14:35:08 2022 +0000
@@ -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 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 @@
         * 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 @@
                        epoch = 1;
                atomic_store_relaxed(&E->epoch, epoch);
        }
+       KASSERT(E->epoch != (unsigned)-1);
 
        /* Notify waiters.  */
        if (E->stage >= ENTROPY_WARM) {
diff -r 0c4f07216f3b -r f499d983bf25 sys/sys/rnd.h
--- a/sys/sys/rnd.h     Sat Mar 19 14:34:47 2022 +0000
+++ b/sys/sys/rnd.h     Sat Mar 19 14:35:08 2022 +0000
@@ -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_seed(void *, size_t);
 int            rnd_system_ioctl(struct file *, u_long, void *);
 
-extern int     rnd_initial_entropy;
-
 #endif /* _KERNEL */
 
 #endif /* !_SYS_RND_H_ */



Home | Main Index | Thread Index | Old Index