sim: Pass boot_rsp down from the simulator
Instead of having this struct at a fairly low level in the simulator,
with the filled-in values effectively discarded after each call, pass
the value from higher up in the simulator. This prepares us for being
able to use the resulting data in upcoming tests.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/mcuboot-sys/csupport/run.c b/sim/mcuboot-sys/csupport/run.c
index 65e943a..4786cbc 100644
--- a/sim/mcuboot-sys/csupport/run.c
+++ b/sim/mcuboot-sys/csupport/run.c
@@ -244,10 +244,10 @@
uint32_t num_slots;
};
-int invoke_boot_go(struct sim_context *ctx, struct area_desc *adesc)
+int invoke_boot_go(struct sim_context *ctx, struct area_desc *adesc,
+ struct boot_rsp *rsp)
{
int res;
- struct boot_rsp rsp;
struct boot_loader_state *state;
#if defined(MCUBOOT_SIGN_RSA) || \
@@ -264,7 +264,7 @@
sim_set_context(ctx);
if (setjmp(ctx->boot_jmpbuf) == 0) {
- res = context_boot_go(state, &rsp);
+ res = context_boot_go(state, rsp);
sim_reset_flash_areas();
sim_reset_context();
free(state);