/ src / arch / ppc64 / boot.c
boot.c
 1  /* SPDX-License-Identifier: GPL-2.0-only */
 2  
 3  #include <program_loading.h>
 4  
 5  #if ENV_PAYLOAD_LOADER
 6  
 7  /*
 8   * Payload's entry point is an offset to the real entry point, not to OPD
 9   * (Official Procedure Descriptor) for entry point.
10   */
11  void arch_prog_run(struct prog *prog)
12  {
13  	asm volatile(
14  	    "mtctr %1\n"
15  	    "mr 3, %0\n"
16  	    "bctr\n"
17  	    :: "r"(prog_entry_arg(prog)), "r"(prog_entry(prog)) : "memory");
18  }
19  
20  #else
21  
22  void arch_prog_run(struct prog *prog)
23  {
24  	void (*doit)(void *) = prog_entry(prog);
25  
26  	doit(prog_entry_arg(prog));
27  }
28  
29  #endif