1 /* SPDX-License-Identifier: GPL-2.0 */
3 * relocate_kernel.S - put the kernel image in place to boot
6 #include <linux/linkage.h>
7 #include <asm/assembler.h>
8 #include <asm/asm-offsets.h>
11 .align 3 /* not needed for this code, but keeps fncpy() happy */
13 ENTRY(relocate_new_kernel)
15 adr r7, relocate_new_kernel_end
16 ldr r0, [r7, #KEXEC_INDIR_PAGE]
17 ldr r1, [r7, #KEXEC_START_ADDR]
20 * If there is no indirection page (we are doing crashdumps)
21 * skip any relocation.
26 0: /* top, read another word for the indirection page */
29 /* Is it a destination page. Put destination address to r4 */
35 /* Is it an indirection page */
61 /* Jump to relocated kernel */
64 ldr r1, [r7, #KEXEC_MACH_TYPE]
65 ldr r2, [r7, #KEXEC_R2]
69 ENDPROC(relocate_new_kernel)
72 relocate_new_kernel_end:
74 .globl relocate_new_kernel_size
75 relocate_new_kernel_size:
76 .long relocate_new_kernel_end - relocate_new_kernel