boot state: rebalance payload load vs actual boot
The notion of loading a payload in the current boot state machine isn't actually loading the payload. The reason is that cbfs is just walked to find the payload. The actual loading and booting were occuring in selfboot(). Change this balance so that loading occurs in one function and actual booting happens in another. This allows for ample opportunity to delay work until just before booting. Change-Id: Ic91ed6050fc5d8bb90c8c33a44eea3b1ec84e32d Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/3139 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
committed by
Ronald G. Minnich
parent
bebf66909a
commit
001de1aeb0
@ -198,6 +198,7 @@ static boot_state_t bs_write_tables(void *arg)
|
||||
static boot_state_t bs_payload_load(void *arg)
|
||||
{
|
||||
void *payload;
|
||||
void *entry;
|
||||
|
||||
timestamp_add_now(TS_LOAD_PAYLOAD);
|
||||
|
||||
@ -206,15 +207,20 @@ static boot_state_t bs_payload_load(void *arg)
|
||||
if (! payload)
|
||||
die("Could not find a payload\n");
|
||||
|
||||
entry = selfload(get_lb_mem(), payload);
|
||||
|
||||
if (! entry)
|
||||
die("Could not load payload\n");
|
||||
|
||||
/* Pass the payload to the next state. */
|
||||
boot_states[BS_PAYLOAD_BOOT].arg = payload;
|
||||
boot_states[BS_PAYLOAD_BOOT].arg = entry;
|
||||
|
||||
return BS_PAYLOAD_BOOT;
|
||||
}
|
||||
|
||||
static boot_state_t bs_payload_boot(void *payload)
|
||||
static boot_state_t bs_payload_boot(void *entry)
|
||||
{
|
||||
selfboot(get_lb_mem(), payload);
|
||||
selfboot(entry);
|
||||
|
||||
printk(BIOS_EMERG, "Boot failed");
|
||||
/* Returning from this state will fail because the following signals
|
||||
|
Reference in New Issue
Block a user