aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/random/randomdev.h
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2019-12-26 19:32:11 +0000
committerConrad Meyer <cem@FreeBSD.org>2019-12-26 19:32:11 +0000
commit3ee1d5bb9dc2db929b19ca59421d197153dbdc08 (patch)
tree77b0983d76aeae4b202ee38a76066a33518433d2 /sys/dev/random/randomdev.h
parentaf00898b5d7bac6734c407c1d2f4362a08fe4532 (diff)
Notes
Diffstat (limited to 'sys/dev/random/randomdev.h')
-rw-r--r--sys/dev/random/randomdev.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h
index 896b31a5fea23..a5b060c1b376c 100644
--- a/sys/dev/random/randomdev.h
+++ b/sys/dev/random/randomdev.h
@@ -79,15 +79,18 @@ typedef u_int random_source_read_t(void *, u_int);
struct random_algorithm {
const char *ra_ident;
u_int ra_poolcount;
- void (*ra_init_alg)(void *);
- void (*ra_deinit_alg)(void *);
random_alg_pre_read_t *ra_pre_read;
random_alg_read_t *ra_read;
random_alg_seeded_t *ra_seeded;
random_alg_eventprocessor_t *ra_event_processor;
};
-extern struct random_algorithm random_alg_context, *p_random_alg_context;
+#if defined(RANDOM_LOADABLE)
+extern const struct random_algorithm *p_random_alg_context;
+#else
+extern const struct random_algorithm random_alg_context;
+#define p_random_alg_context (&random_alg_context)
+#endif
#ifdef _KERNEL
@@ -105,19 +108,6 @@ struct random_source {
void random_source_register(struct random_source *);
void random_source_deregister(struct random_source *);
-#if defined(RANDOM_LOADABLE)
-extern struct sx randomdev_config_lock;
-#define RANDOM_CONFIG_INIT_LOCK(x) sx_init(&randomdev_config_lock, "configuration change lock")
-#define RANDOM_CONFIG_X_LOCK(x) sx_xlock(&randomdev_config_lock)
-#define RANDOM_CONFIG_X_UNLOCK(x) sx_xunlock(&randomdev_config_lock)
-#define RANDOM_CONFIG_S_LOCK(x) sx_slock(&randomdev_config_lock)
-#define RANDOM_CONFIG_S_UNLOCK(x) sx_sunlock(&randomdev_config_lock)
-#define RANDOM_CONFIG_DEINIT_LOCK(x) sx_destroy(&randomdev_config_lock)
-void random_infra_init(int (*)(struct uio *, bool), void (*)(void *, u_int),
- bool (*)(void));
-void random_infra_uninit(void);
-#endif
-
#endif /* _KERNEL */
void randomdev_unblock(void);