kernel: init: Build constant in early random generator

Use a Kconfig symbol for initial state in the early
random number generator.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2023-10-10 10:31:35 -07:00 committed by Johan Hedberg
parent a99a0700ba
commit 991ff6f48b

View file

@ -511,7 +511,7 @@ static FUNC_NORETURN void switch_to_main_thread(char *stack_ptr)
__boot_func __boot_func
void __weak z_early_rand_get(uint8_t *buf, size_t length) void __weak z_early_rand_get(uint8_t *buf, size_t length)
{ {
static uint64_t state = 123456789UL; static uint64_t state = (uint64_t)CONFIG_TIMER_RANDOM_INITIAL_STATE;
int rc; int rc;
#ifdef CONFIG_ENTROPY_HAS_DRIVER #ifdef CONFIG_ENTROPY_HAS_DRIVER