Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/random/unit_test.h
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | enum random_entropy_source { | ||||
RANDOM_START = 0, | RANDOM_START = 0, | ||||
RANDOM_CACHED = 0, | RANDOM_CACHED = 0, | ||||
ENTROPYSOURCE = 32 | ENTROPYSOURCE = 32 | ||||
}; | }; | ||||
struct harvest_event { | struct harvest_event { | ||||
uintmax_t he_somecounter; /* fast counter for clock jitter */ | uintmax_t he_somecounter; /* fast counter for clock jitter */ | ||||
uint32_t he_entropy[HARVESTSIZE];/* some harvested entropy */ | uint32_t he_entropy[HARVESTSIZE];/* some harvested entropy */ | ||||
u_int he_size; /* harvested entropy byte count */ | uint8_t he_size; /* harvested entropy byte count */ | ||||
u_int he_bits; /* stats about the entropy */ | uint8_t he_destination; /* destination pool of this entropy */ | ||||
u_int he_destination; /* destination pool of this entropy */ | |||||
enum random_entropy_source he_source; /* origin of the entropy */ | enum random_entropy_source he_source; /* origin of the entropy */ | ||||
void * he_next; /* next item on the list */ | void * he_next; /* next item on the list */ | ||||
}; | }; | ||||
struct sysctl_ctx_list; | struct sysctl_ctx_list; | ||||
#define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") | #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") | ||||
#define KASSERT(exp,msg) do { \ | #define KASSERT(exp,msg) do { \ | ||||
if (!(exp)) { \ | if (!(exp)) { \ | ||||
printf msg; \ | printf msg; \ | ||||
exit(0); \ | exit(0); \ | ||||
} \ | } \ | ||||
} while (0) | } while (0) | ||||
#endif /* UNIT_TEST_H_INCLUDED */ | #endif /* UNIT_TEST_H_INCLUDED */ |