diff options
author | Sergii Dmytruk <sergii.dmytruk@3mdeb.com> | 2021-08-19 20:19:19 +0300 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-02-11 20:17:45 +0000 |
commit | dba9b54731c000b26334bd31a7dbd0fa2dbe80aa (patch) | |
tree | 0d70f5d1c7e162f403581c45dddee77e7fbb5dcc /src/arch | |
parent | 956a8b69d2eaaf597909ff8b5c16b87085eba440 (diff) |
arch/ppc64/boot.c: handle non-OPD entry point
Change-Id: I309be370d66a808b355241fcee880883631f38ce
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57083
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
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 |