Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/random/random_harvestq.h
/*- | /*- | ||||
* Copyright (c) 2013-2015 Mark R V Murray | * Copyright (c) 2013-2015, 2017 Mark R V Murray | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer | * notice, this list of conditions and the following disclaimer | ||||
* in this position and unchanged. | * in this position and unchanged. | ||||
Show All 28 Lines | struct harvest_event { | ||||
uint32_t he_entropy[HARVESTSIZE];/* some harvested entropy */ | uint32_t he_entropy[HARVESTSIZE];/* some harvested entropy */ | ||||
uint8_t he_size; /* harvested entropy byte count */ | uint8_t he_size; /* harvested entropy byte count */ | ||||
uint8_t he_bits; /* stats about the entropy */ | uint8_t he_bits; /* stats about the entropy */ | ||||
uint8_t he_destination; /* destination pool of this entropy */ | uint8_t he_destination; /* destination pool of this entropy */ | ||||
uint8_t he_source; /* origin of the entropy */ | uint8_t he_source; /* origin of the entropy */ | ||||
} __packed; | } __packed; | ||||
void read_rate_increment(u_int); | void read_rate_increment(u_int); | ||||
#define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" | |||||
#define RANDOM_HARVEST_INIT_LOCK(x) mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, MTX_SPIN) | #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_LOCK(x) mtx_lock_spin(&harvest_context.hc_mtx) | ||||
#define RANDOM_HARVEST_UNLOCK(x) mtx_unlock_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 */ | #endif /* SYS_DEV_RANDOM_RANDOM_HARVESTQ_H_INCLUDED */ |