2 * This is the analog to the kexec "purgatory" code
4 * The goal here is to call the actual kernel entry point with the arguments it
5 * expects when kexec calls into it with no arguments. The value of the kernel
6 * entry point and arguments r3-r7 are copied into the trampoline text (which
7 * can be executed from any address) at bytes 8-32. kexec begins execution
8 * of APs at 0x60 bytes past the entry point, executing in a copy relocated
9 * to the absolute address 0x60. Here we implement a loop waiting on the release
10 * of a lock by the kernel at 0x40.
15 #include <machine/asm.h>
17 .globl CNAME(kerneltramp),CNAME(szkerneltramp)
21 .space 24 /* branch address, r3-r7 */
24 * MUST BE IN SYNC WITH:
25 * struct trampoline_data {
26 * uint32_t kernel_entry;
28 * uint32_t phys_mem_offset;
35 . = kerneltramp + 0x40 /* AP spinlock */
38 . = kerneltramp + 0x60 /* AP entry point */
44 /* Jump into CPU reset */
51 2: /* Continuation of kerneltramp */
56 andi. %r10, %r10, 1 /* test MSR_LE */
59 /* We're starting in BE */
71 /* We're starting in LE */
74 /* Entries are BE, swap them during load. */
86 /* Clear MSR_LE flag to enter the BE world */
91 /* Entry is at 0(%r8) */
101 CNAME(szkerneltramp):
102 .long endkerneltramp - CNAME(kerneltramp)