PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
rand.c File Reference
#include <kernel/drivers/rand.h>
#include <kernel/cpu/cpu.h>
#include <kernel/log/log.h>
#include <kernel/sched/clock.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/cpuid.h>
Include dependency graph for rand.c:

Go to the source code of this file.

Functions

static uint64_t rand_gen_fallback (void *buffer, uint64_t size)
 
 PERCPU_DEFINE_CTOR (rand_cpu_t, pcpu_rand)
 
uint64_t rand_gen (void *buffer, uint64_t size)
 Fills a buffer with random bytes.
 

Variables

static atomic_uint64_t seed = ATOMIC_VAR_INIT(0x123456789ABCDEF0)
 

Function Documentation

◆ rand_gen_fallback()

static uint64_t rand_gen_fallback ( void *  buffer,
uint64_t  size 
)
static

Definition at line 14 of file rand.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PERCPU_DEFINE_CTOR()

PERCPU_DEFINE_CTOR ( rand_cpu_t  ,
pcpu_rand   
)

Definition at line 29 of file rand.c.

Here is the call graph for this function:

Variable Documentation

◆ seed

atomic_uint64_t seed = ATOMIC_VAR_INIT(0x123456789ABCDEF0)
static

Definition at line 12 of file rand.c.