aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2019-11-22 20:24:15 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2022-02-17 04:57:46 +0000
commitedede7d79a26e747460586d0621a59fa7ed35f7e (patch)
treec0c985b5af8dd2bdd311fec2fdf178d75499230a
parent332166892ef341664a733e581ea99c0adad17566 (diff)
downloadsrc-edede7d79a26e747460586d0621a59fa7ed35f7e.tar.gz
src-edede7d79a26e747460586d0621a59fa7ed35f7e.zip
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. (cherry picked from commit b6db1cc7100350790201bfa550ec47d9a5fbe781)
-rw-r--r--sys/dev/random/random_harvestq.c8
-rw-r--r--sys/dev/random/random_infra.c2
-rw-r--r--sys/dev/random/randomdev.h8
3 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c
index 0c6777ba9d0d..035b5c028fb6 100644
--- a/sys/dev/random/random_harvestq.c
+++ b/sys/dev/random/random_harvestq.c
@@ -87,6 +87,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");
diff --git a/sys/dev/random/random_infra.c b/sys/dev/random/random_infra.c
index 9a40c35f12b7..19973ac4b46d 100644
--- a/sys/dev/random/random_infra.c
+++ b/sys/dev/random/random_infra.c
@@ -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) */
diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h
index abed568fb215..896b31a5fea2 100644
--- a/sys/dev/random/randomdev.h
+++ b/sys/dev/random/randomdev.h
@@ -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 *);