18 currentSeed ^= currentSeed << 13;
19 currentSeed ^= currentSeed >> 7;
20 currentSeed ^= currentSeed << 17;
73 while (remaining >=
sizeof(
uint32_t))
94 memcpy(ptr, &value, remaining);
static cpu_t * smp_self_unsafe(void)
Returns a pointer to the cpu_t structure of the current CPU.
static cpu_t * smp_self(void)
Returns a pointer to the cpu_t structure of the current CPU.
static void smp_put(void)
Re-enables interrupts after a call to smp_self().
uint64_t rdrand_do(uint32_t *value, uint8_t retries)
Generates a random 32-bit unsigned integer using the RDRAND instruction.
void rand_cpu_init(rand_cpu_ctx_t *ctx)
Initializes the random number generator.
uint64_t rand_gen(void *buffer, uint64_t size)
Fills a buffer with random bytes.
#define LOG_WARN(format,...)
clock_t timer_uptime(void)
Time since boot.
static void cpuid_feature_info(cpuid_feature_info_t *info)
Wrapper to get CPU feature information.
#define ERR
Integer error value.
static uint64_t rand_gen_fallback(void *buffer, uint64_t size)
static atomic_uint64_t seed
EFI_PHYSICAL_ADDRESS buffer
#define atomic_store(object, desired)
#define atomic_load(object)
#define ATOMIC_VAR_INIT(value)
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
CPU feature information structure.
CPU random number generator context.
bool rdrandAvail
If set, the RDRAND instruction is avilable and working.