summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbmem_stage_cache.c4
-rw-r--r--src/lib/rmodule.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/cbmem_stage_cache.c b/src/lib/cbmem_stage_cache.c
index 3fc99db726..2947972ac5 100644
--- a/src/lib/cbmem_stage_cache.c
+++ b/src/lib/cbmem_stage_cache.c
@@ -29,6 +29,7 @@ void stage_cache_add(int stage_id, const struct prog *stage)
return;
meta->load_addr = (uintptr_t)prog_start(stage);
meta->entry_addr = (uintptr_t)prog_entry(stage);
+ meta->arg = (uintptr_t)prog_entry_arg(stage);
c = cbmem_add(CBMEM_ID_STAGEx_CACHE + stage_id, prog_size(stage));
if (c == NULL)
@@ -63,5 +64,6 @@ void stage_cache_load_stage(int stage_id, struct prog *stage)
memcpy(load_addr, c, size);
prog_set_area(stage, load_addr, size);
- prog_set_entry(stage, (void *)(uintptr_t)meta->entry_addr, NULL);
+ prog_set_entry(stage, (void *)(uintptr_t)meta->entry_addr,
+ (void *)(uintptr_t)meta->arg);
}
diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c
index a3a74ac613..66d5120fee 100644
--- a/src/lib/rmodule.c
+++ b/src/lib/rmodule.c
@@ -294,10 +294,11 @@ int rmodule_stage_load(struct rmod_stage_load *rsl)
prog_set_area(rsl->prog, rmod_stage.location,
rmodule_memory_size(&rmod_stage));
- prog_set_entry(rsl->prog, rmodule_entry(&rmod_stage), NULL);
/* Allow caller to pick up parameters, if available. */
rsl->params = rmodule_parameters(&rmod_stage);
+ prog_set_entry(rsl->prog, rmodule_entry(&rmod_stage), rsl->params);
+
return 0;
}