From dba9b54731c000b26334bd31a7dbd0fa2dbe80aa Mon Sep 17 00:00:00 2001 From: Sergii Dmytruk Date: Thu, 19 Aug 2021 20:19:19 +0300 Subject: arch/ppc64/boot.c: handle non-OPD entry point Change-Id: I309be370d66a808b355241fcee880883631f38ce Signed-off-by: Sergii Dmytruk Reviewed-on: https://review.coreboot.org/c/coreboot/+/57083 Tested-by: build bot (Jenkins) Reviewed-by: Krystian Hebel Reviewed-by: Arthur Heymans --- src/arch/ppc64/boot.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/arch/ppc64/boot.c') 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 +#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 -- cgit v1.2.3