diff options
Diffstat (limited to 'src/arch/arm64/boot.c')
-rw-r--r-- | src/arch/arm64/boot.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/arch/arm64/boot.c b/src/arch/arm64/boot.c index 74282a9cde..b5e375193e 100644 --- a/src/arch/arm64/boot.c +++ b/src/arch/arm64/boot.c @@ -25,15 +25,16 @@ #include <arch/transition.h> #include <console/console.h> #include <program_loading.h> +#include <rules.h> #include <string.h> -void arch_payload_run(const struct payload *payload) +static void run_payload(struct prog *prog) { void (*doit)(void *); void *arg; - doit = prog_entry(&payload->prog); - arg = prog_entry_arg(&payload->prog); + doit = prog_entry(prog); + arg = prog_entry_arg(prog); uint8_t current_el = get_current_el(); @@ -61,3 +62,23 @@ void arch_payload_run(const struct payload *payload) cache_sync_instructions(); transition_with_entry(doit, arg, &exc_state); } + +void arch_prog_run(struct prog *prog) +{ + void (*doit)(void *); + void *arg; + + if (ENV_RAMSTAGE && prog->type == PROG_PAYLOAD) + run_payload(prog); + return; + + doit = prog_entry(prog); + arg = prog_entry_arg(prog); + + doit(prog_entry_arg(prog)); +} + +void arch_payload_run(struct payload *payload) +{ + arch_prog_run(&payload->prog); +} |