iPXE
|
EFI entropy source. More...
Go to the source code of this file.
Macros | |
#define | EFI_ENTROPY_TRIGGER_TIME 10 |
Time (in 100ns units) to delay waiting for timer tick. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct entropy_source efitick_entropy | __entropy_source (ENTROPY_FALLBACK) |
EFI entropy source. More... | |
static int | efi_entropy_enable (void) |
Enable entropy gathering. More... | |
static void | efi_entropy_disable (void) |
Disable entropy gathering. More... | |
static int | efi_entropy_tick (void) |
Wait for a timer tick. More... | |
static int | efi_get_noise (noise_sample_t *noise) |
Get noise sample from timer ticks. More... | |
Variables | |
static EFI_EVENT | tick |
Event used to wait for timer tick. More... | |
EFI entropy source.
Definition in file efi_entropy.c.
#define EFI_ENTROPY_TRIGGER_TIME 10 |
Time (in 100ns units) to delay waiting for timer tick.
In theory, UEFI allows us to specify a trigger time of zero to simply wait for the next timer tick. In practice, specifying zero seems to often return immediately, which produces almost no entropy. Specify a delay of 1000ns to try to force an existent delay.
Definition at line 47 of file efi_entropy.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct entropy_source efitick_entropy __entropy_source | ( | ENTROPY_FALLBACK | ) |
EFI entropy source.
|
static |
Enable entropy gathering.
rc | Return status code |
Definition at line 57 of file efi_entropy.c.
References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CreateEvent, DBGC, EEFI, efi_external_tpl, efi_systab, entropy_init(), EVT_TIMER, MIN_ENTROPY, NULL, rc, EFI_BOOT_SERVICES::RestoreTPL, strerror(), tick, and TPL_NOTIFY.
|
static |
Disable entropy gathering.
Definition at line 87 of file efi_entropy.c.
References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseEvent, efi_internal_tpl, efi_systab, EFI_BOOT_SERVICES::RaiseTPL, and tick.
|
static |
Wait for a timer tick.
low | CPU profiling low-order bits, or negative error |
Definition at line 102 of file efi_entropy.c.
References EFI_SYSTEM_TABLE::BootServices, DBGC, EEFI, EFI_ENTROPY_TRIGGER_TIME, efi_systab, index, low, profile_timestamp(), rc, EFI_BOOT_SERVICES::SetTimer, strerror(), tick, TimerRelative, and EFI_BOOT_SERVICES::WaitForEvent.
Referenced by efi_get_noise().
|
static |
Get noise sample from timer ticks.
noise | Noise sample |
rc | Return status code |
Definition at line 136 of file efi_entropy.c.
References after, before, efi_entropy_tick(), and rc.
|
static |
Event used to wait for timer tick.
Definition at line 50 of file efi_entropy.c.
Referenced by efi_entropy_disable(), efi_entropy_enable(), efi_entropy_tick(), and fiber_autoneg().