Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/random/randomdev.h
Show All 31 Lines | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* This header contains only those definitions that are global | /* This header contains only those definitions that are global | ||||
* and non algorithm-specific for the entropy processor | * and non algorithm-specific for the entropy processor | ||||
*/ | */ | ||||
#ifdef SYSCTL_DECL /* from sysctl.h */ | #ifdef SYSCTL_DECL /* from sysctl.h */ | ||||
SYSCTL_DECL(_kern_random); | SYSCTL_DECL(_kern_random); | ||||
SYSCTL_DECL(_kern_random_initial_seeding); | |||||
#define RANDOM_CHECK_UINT(name, min, max) \ | #define RANDOM_CHECK_UINT(name, min, max) \ | ||||
static int \ | static int \ | ||||
random_check_uint_##name(SYSCTL_HANDLER_ARGS) \ | random_check_uint_##name(SYSCTL_HANDLER_ARGS) \ | ||||
{ \ | { \ | ||||
if (oidp->oid_arg1 != NULL) { \ | if (oidp->oid_arg1 != NULL) { \ | ||||
if (*(u_int *)(oidp->oid_arg1) <= (min)) \ | if (*(u_int *)(oidp->oid_arg1) <= (min)) \ | ||||
*(u_int *)(oidp->oid_arg1) = (min); \ | *(u_int *)(oidp->oid_arg1) = (min); \ | ||||
else if (*(u_int *)(oidp->oid_arg1) > (max)) \ | else if (*(u_int *)(oidp->oid_arg1) > (max)) \ | ||||
*(u_int *)(oidp->oid_arg1) = (max); \ | *(u_int *)(oidp->oid_arg1) = (max); \ | ||||
} \ | } \ | ||||
return (sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, \ | return (sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, \ | ||||
req)); \ | req)); \ | ||||
} | } | ||||
#endif /* SYSCTL_DECL */ | #endif /* SYSCTL_DECL */ | ||||
MALLOC_DECLARE(M_ENTROPY); | MALLOC_DECLARE(M_ENTROPY); | ||||
extern bool random_bypass_before_seeding; | |||||
extern bool read_random_bypassed_before_seeding; | |||||
extern bool arc4random_bypassed_before_seeding; | |||||
extern bool random_bypass_disable_warnings; | |||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
struct harvest_event; | struct harvest_event; | ||||
typedef void random_alg_init_t(void *); | typedef void random_alg_init_t(void *); | ||||
typedef void random_alg_deinit_t(void *); | typedef void random_alg_deinit_t(void *); | ||||
typedef void random_alg_pre_read_t(void); | typedef void random_alg_pre_read_t(void); | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |