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 * cpu_get_unsafe(void)
Gets the current CPU structure without disabling interrupts.
static cpu_t * cpu_get(void)
Gets the current CPU structure.
static void cpu_put(void)
Releases the current CPU structure.
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 clock_uptime(void)
Retrieve the time in nanoseconds 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 available and working.