Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18230c5b authored by Laura Abbott's avatar Laura Abbott
Browse files

arm: Add weak function definition for random pool intialization



The random pool relies on devices and other items in the system
to add entropy to the pool. Most of these devices may not be
added until later in the bootup process. This leaves a large
period of time where the random pool may not actually give
random numbers. Add a weak function for devices to override
with their own function to setup the random pool.

Change-Id: I0de63420b11f1dd363ccd0ef6ac0fa4a617a1152
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent c1a5a21e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -841,6 +841,8 @@ void __init hyp_mode_check(void)
#endif
}

void __init __weak init_random_pool(void) { }

void __init setup_arch(char **cmdline_p)
{
	const struct machine_desc *mdesc;
@@ -912,6 +914,8 @@ void __init setup_arch(char **cmdline_p)

	if (mdesc->init_early)
		mdesc->init_early();

	init_random_pool();
}


+3 −0
Original line number Diff line number Diff line
@@ -372,6 +372,8 @@ static void __init request_standard_resources(void)

u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };

void __init __weak init_random_pool(void) { }

void __init setup_arch(char **cmdline_p)
{
	/*
@@ -421,6 +423,7 @@ void __init setup_arch(char **cmdline_p)
	conswitchp = &dummy_con;
#endif
#endif
	init_random_pool();
}

static int __init arm64_device_init(void)