Author: cem
Date: Fri Nov 22 20:24:15 2019
New Revision: 355022
URL: https://svnweb.freebsd.org/changeset/base/355022

Log:
  random(4): De-export random_sources list
  
  The internal datastructures do not need to be visible outside of
  random_harvestq, and this helps ensure they are not misused.
  
  No functional change.
  
  Approved by:  csprng(delphij, markm)
  Differential Revision:        https://reviews.freebsd.org/D22485

Modified:
  head/sys/dev/random/random_harvestq.c
  head/sys/dev/random/random_infra.c
  head/sys/dev/random/randomdev.h

Modified: head/sys/dev/random/random_harvestq.c
==============================================================================
--- head/sys/dev/random/random_harvestq.c       Fri Nov 22 20:23:22 2019        
(r355021)
+++ head/sys/dev/random/random_harvestq.c       Fri Nov 22 20:24:15 2019        
(r355022)
@@ -98,6 +98,14 @@ volatile int random_kthread_control;
  */
 __read_frequently u_int hc_source_mask;
 
+struct random_sources {
+       LIST_ENTRY(random_sources)       rrs_entries;
+       struct random_source            *rrs_source;
+};
+
+static LIST_HEAD(sources_head, random_sources) source_list =
+    LIST_HEAD_INITIALIZER(source_list);
+
 SYSCTL_NODE(_kern_random, OID_AUTO, harvest, CTLFLAG_RW, 0,
     "Entropy Device Parameters");
 

Modified: head/sys/dev/random/random_infra.c
==============================================================================
--- head/sys/dev/random/random_infra.c  Fri Nov 22 20:23:22 2019        
(r355021)
+++ head/sys/dev/random/random_infra.c  Fri Nov 22 20:24:15 2019        
(r355022)
@@ -101,8 +101,6 @@ SYSCTL_BOOL(_kern_random_initial_seeding, OID_AUTO,
 
 MALLOC_DEFINE(M_ENTROPY, "entropy", "Entropy harvesting buffers and data 
structures");
 
-struct sources_head source_list = LIST_HEAD_INITIALIZER(source_list);
-
 #if defined(RANDOM_LOADABLE)
 struct random_algorithm *p_random_alg_context = NULL;
 #else /* !defined(RANDOM_LOADABLE) */

Modified: head/sys/dev/random/randomdev.h
==============================================================================
--- head/sys/dev/random/randomdev.h     Fri Nov 22 20:23:22 2019        
(r355021)
+++ head/sys/dev/random/randomdev.h     Fri Nov 22 20:24:15 2019        
(r355022)
@@ -102,14 +102,6 @@ struct random_source {
        random_source_read_t            *rs_read;
 };
 
-struct random_sources {
-       LIST_ENTRY(random_sources)       rrs_entries;
-       struct random_source            *rrs_source;
-};
-
-LIST_HEAD(sources_head, random_sources);
-extern struct sources_head source_list;
-
 void random_source_register(struct random_source *);
 void random_source_deregister(struct random_source *);
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to