summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/x86/postcar_loader.c2
-rw-r--r--src/include/program_loading.h5
-rw-r--r--src/lib/prog_loaders.c5
3 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index c6149ab26a..0a5d50cc1a 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -225,5 +225,7 @@ void run_postcar_phase(struct postcar_frame *pcf)
/* As postcar exist, it's end of romstage here */
timestamp_add_now(TS_END_ROMSTAGE);
+ prog_set_arg(&prog, cbmem_top());
+
prog_run(&prog);
}
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 601847d4f8..1b71fadb1b 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -137,6 +137,11 @@ static inline void prog_set_entry(struct prog *prog, void *e, void *arg)
prog->arg = arg;
}
+static inline void prog_set_arg(struct prog *prog, void *arg)
+{
+ prog->arg = arg;
+}
+
/* Locate the identified program to run. Return 0 on success. < 0 on error. */
int prog_locate(struct prog *prog);
/* The prog_locate_hook() is called prior to CBFS traversal. The hook can be
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index 5048c99418..183a22bff0 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -96,6 +96,8 @@ static void run_ramstage_from_resume(struct prog *ramstage)
/* Load the cached ramstage to runtime location. */
stage_cache_load_stage(STAGE_RAMSTAGE, ramstage);
+ prog_set_arg(ramstage, cbmem_top());
+
if (prog_entry(ramstage) != NULL) {
printk(BIOS_DEBUG, "Jumping to image.\n");
prog_run(ramstage);
@@ -148,6 +150,9 @@ void run_ramstage(void)
timestamp_add_now(TS_END_COPYRAM);
+ /* This overrides the arg fetched from the relocatable module */
+ prog_set_arg(&ramstage, cbmem_top());
+
prog_run(&ramstage);
fail: