From 1322d7f9d58f355f469ab7b993f7da5b6117edb6 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 24 Feb 2014 21:24:28 -0600 Subject: coreboot: move common code to payload_run() from selfboot() The selfboot() routine was perfoming most of the common teardown and stack checking infrastructure. Move that code into payload_run() to prepare removal of the selfboot() function. Change-Id: I29f2a5cfcc692f7a0fe2656cb1cda18158c49c6e Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/5297 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Paul Menzel Reviewed-by: Alexandru Gagniuc --- src/lib/loaders/load_and_run_payload.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/lib/loaders') diff --git a/src/lib/loaders/load_and_run_payload.c b/src/lib/loaders/load_and_run_payload.c index 46db93c719..96f5e27580 100644 --- a/src/lib/loaders/load_and_run_payload.c +++ b/src/lib/loaders/load_and_run_payload.c @@ -21,7 +21,10 @@ #include #include #include +#include +#include #include +#include extern const struct payload_loader_ops vboot_payload_loader; extern const struct payload_loader_ops cbfs_payload_loader; @@ -77,5 +80,18 @@ void payload_run(const struct payload *payload) if (payload == NULL) return; + /* Reset to booting from this image as late as possible */ + boot_successful(); + + printk(BIOS_DEBUG, "Jumping to boot code at %p\n", payload->entry); + post_code(POST_ENTER_ELF_BOOT); + + timestamp_add_now(TS_SELFBOOT_JUMP); + + /* Before we go off to run the payload, see if + * we stayed within our bounds. + */ + checkstack(_estack, 0); + selfboot(payload->entry); } -- cgit v1.2.3