kernel: random: Make z_early_rand_get a weak symbol

Allow targets come up with their own early random generator
since the default can be NOT so random due constraints.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2023-10-09 15:25:42 -07:00 committed by Johan Hedberg
commit 974e336140

View file

@ -510,7 +510,7 @@ static FUNC_NORETURN void switch_to_main_thread(char *stack_ptr)
#if defined(CONFIG_ENTROPY_HAS_DRIVER) || defined(CONFIG_TEST_RANDOM_GENERATOR)
__boot_func
void z_early_rand_get(uint8_t *buf, size_t length)
void __weak z_early_rand_get(uint8_t *buf, size_t length)
{
#ifdef CONFIG_ENTROPY_HAS_DRIVER
const struct device *const entropy = DEVICE_DT_GET_OR_NULL(DT_CHOSEN(zephyr_entropy));