Aaron Durbin (adurbin@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5297
-gerrit
commit b4343376e9931271dbacfd5d65cf3462a5c9f889 Author: Aaron Durbin adurbin@chromium.org Date: Mon Feb 24 21:24:28 2014 -0600
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 adurbin@chromium.org --- src/lib/loaders/load_and_run_payload.c | 16 ++++++++++++++++ src/lib/selfboot.c | 19 ------------------- 2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/src/lib/loaders/load_and_run_payload.c b/src/lib/loaders/load_and_run_payload.c index 46db93c..96f5e27 100644 --- a/src/lib/loaders/load_and_run_payload.c +++ b/src/lib/loaders/load_and_run_payload.c @@ -21,7 +21,10 @@ #include <stdlib.h> #include <console/console.h> #include <boot/coreboot_tables.h> +#include <fallback.h> +#include <lib.h> #include <payload_loader.h> +#include <timestamp.h>
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); } diff --git a/src/lib/selfboot.c b/src/lib/selfboot.c index c0986d1..6f200fa 100644 --- a/src/lib/selfboot.c +++ b/src/lib/selfboot.c @@ -22,16 +22,12 @@ #include <arch/stages.h> #include <console/console.h> #include <cpu/cpu.h> -#include <fallback.h> #include <boot/coreboot_tables.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <cbfs.h> #include <lib.h> -#if CONFIG_COLLECT_TIMESTAMPS -#include <timestamp.h> -#endif #include <payload_loader.h>
/* Maximum physical address we can use for the coreboot bounce buffer. */ @@ -527,21 +523,6 @@ out:
void selfboot(void *entry) { - /* Reset to booting from this image as late as possible */ - boot_successful(); - - printk(BIOS_DEBUG, "Jumping to boot code at %p\n", entry); - post_code(POST_ENTER_ELF_BOOT); - -#if CONFIG_COLLECT_TIMESTAMPS - timestamp_add_now(TS_SELFBOOT_JUMP); -#endif - - /* Before we go off to run the payload, see if - * we stayed within our bounds. - */ - checkstack(_estack, 0); - /* Jump to kernel */ jmp_to_elf_entry(entry, bounce_buffer, bounce_size); }