diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/ppc64/boot.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/arch/ppc64/boot.c b/src/arch/ppc64/boot.c index dc4bb422a3..bbd0d39e98 100644 --- a/src/arch/ppc64/boot.c +++ b/src/arch/ppc64/boot.c @@ -2,9 +2,28 @@ #include <program_loading.h> +#if ENV_PAYLOAD_LOADER + +/* + * Payload's entry point is an offset to the real entry point, not to OPD + * (Official Procedure Descriptor) for entry point. + */ +void arch_prog_run(struct prog *prog) +{ + asm volatile( + "mtctr %1\n" + "mr 3, %0\n" + "bctr\n" + :: "r"(prog_entry_arg(prog)), "r"(prog_entry(prog)) : "memory"); +} + +#else + void arch_prog_run(struct prog *prog) { void (*doit)(void *) = prog_entry(prog); doit(prog_entry_arg(prog)); } + +#endif |