Deleted Added
full compact
randomdev_soft.h (253845) randomdev_soft.h (254147)
1/*-
2 * Copyright (c) 2000-2004 Mark R V Murray
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2000-2004 Mark R V Murray
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/random/randomdev_soft.h 253845 2013-07-31 17:21:18Z obrien $
26 * $FreeBSD: head/sys/dev/random/randomdev_soft.h 254147 2013-08-09 15:31:50Z obrien $
27 */
28
29/* This header contains only those definitions that are global
30 * and harvester-specific for the entropy processor
31 */
32
33/* #define ENTROPYSOURCE nn entropy sources (actually classes)
34 * This is properly defined in

--- 32 unchanged lines hidden (view full) ---

67 u_int, u_int, enum esource), int (*)(void *, int));
68void random_yarrow_deinit_harvester(void);
69
70void random_set_wakeup_exit(void *);
71void random_process_event(struct harvest *event);
72void random_yarrow_reseed(void);
73void random_yarrow_unblock(void);
74
27 */
28
29/* This header contains only those definitions that are global
30 * and harvester-specific for the entropy processor
31 */
32
33/* #define ENTROPYSOURCE nn entropy sources (actually classes)
34 * This is properly defined in

--- 32 unchanged lines hidden (view full) ---

67 u_int, u_int, enum esource), int (*)(void *, int));
68void random_yarrow_deinit_harvester(void);
69
70void random_set_wakeup_exit(void *);
71void random_process_event(struct harvest *event);
72void random_yarrow_reseed(void);
73void random_yarrow_unblock(void);
74
75void random_yarrow_init_alg(struct sysctl_ctx_list *, struct sysctl_oid *);
75void random_yarrow_init_alg(struct sysctl_ctx_list *);
76void random_yarrow_deinit_alg(void);
77
76void random_yarrow_deinit_alg(void);
77
78extern struct random_systat random_yarrow;
78extern struct random_adaptor random_yarrow;
79extern struct mtx random_reseed_mtx;
80
81/* If this was c++, this would be a template */
82#define RANDOM_CHECK_UINT(name, min, max) \
83static int \
84random_check_uint_##name(SYSCTL_HANDLER_ARGS) \
85{ \
86 if (oidp->oid_arg1 != NULL) { \
87 if (*(u_int *)(oidp->oid_arg1) <= (min)) \
88 *(u_int *)(oidp->oid_arg1) = (min); \
89 else if (*(u_int *)(oidp->oid_arg1) > (max)) \
90 *(u_int *)(oidp->oid_arg1) = (max); \
91 } \
92 return sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, \
93 req); \
94}
79extern struct mtx random_reseed_mtx;
80
81/* If this was c++, this would be a template */
82#define RANDOM_CHECK_UINT(name, min, max) \
83static int \
84random_check_uint_##name(SYSCTL_HANDLER_ARGS) \
85{ \
86 if (oidp->oid_arg1 != NULL) { \
87 if (*(u_int *)(oidp->oid_arg1) <= (min)) \
88 *(u_int *)(oidp->oid_arg1) = (min); \
89 else if (*(u_int *)(oidp->oid_arg1) > (max)) \
90 *(u_int *)(oidp->oid_arg1) = (max); \
91 } \
92 return sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, \
93 req); \
94}