git: 11d1a5c57900 - stable/14 - random: Move entropy harvest queue lock macros to random_harvestq.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Jul 2025 20:06:44 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=11d1a5c57900b9cc77c6b56516c7be3fda4ecc0e
commit 11d1a5c57900b9cc77c6b56516c7be3fda4ecc0e
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-03 17:21:37 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-10 13:51:41 +0000
random: Move entropy harvest queue lock macros to random_harvestq.c
They can't be used externally, so it makes no sense to have them in a
header. No functional change intended.
Reviewed by: cem
MFC after: 1 week
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51111
(cherry picked from commit 4b8b872a9c55c040eb83f917fc8fd2bf908b96a9)
---
sys/dev/random/random_harvestq.c | 5 +++++
sys/dev/random/random_harvestq.h | 4 ----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/sys/dev/random/random_harvestq.c b/sys/dev/random/random_harvestq.c
index 92af14446e9c..b5e733dcb8e3 100644
--- a/sys/dev/random/random_harvestq.c
+++ b/sys/dev/random/random_harvestq.c
@@ -162,6 +162,11 @@ static struct harvest_context {
} hc_entropy_fast_accumulator;
} harvest_context;
+#define RANDOM_HARVEST_INIT_LOCK() mtx_init(&harvest_context.hc_mtx, \
+ "entropy harvest mutex", NULL, MTX_SPIN)
+#define RANDOM_HARVEST_LOCK() mtx_lock_spin(&harvest_context.hc_mtx)
+#define RANDOM_HARVEST_UNLOCK() mtx_unlock_spin(&harvest_context.hc_mtx)
+
static struct kproc_desc random_proc_kp = {
"rand_harvestq",
random_kthread,
diff --git a/sys/dev/random/random_harvestq.h b/sys/dev/random/random_harvestq.h
index 69a9dfabd44a..edeb4ff7a17f 100644
--- a/sys/dev/random/random_harvestq.h
+++ b/sys/dev/random/random_harvestq.h
@@ -40,8 +40,4 @@ struct harvest_event {
uint8_t he_source; /* origin of the entropy */
};
-#define RANDOM_HARVEST_INIT_LOCK(x) mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, MTX_SPIN)
-#define RANDOM_HARVEST_LOCK(x) mtx_lock_spin(&harvest_context.hc_mtx)
-#define RANDOM_HARVEST_UNLOCK(x) mtx_unlock_spin(&harvest_context.hc_mtx)
-
#endif /* SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED */