If kernel image in uImage or zImage format is not detected by
lowlevel_init.S code then do not clear memory location where image was
expected. If image is not detected then this memory region is unknown.
So do not unconditionally clear it.
Signed-off-by: Pali Rohár <pali@kernel.org>
ldr r4, [r0, #36] /* r4 - 4 bytes header of kernel at offset 36 */
ldr r5, z_magic /* r5 - LINUX_ARM_ZIMAGE_MAGIC */
cmp r4, r5
- bne copy_kernel_end /* skip if invalid image */
+ bne skip_copy /* skip if invalid image */
copy_kernel_loop:
ldmdb r1!, {r3 - r10}
cmp r1, r0
bhi copy_kernel_loop
-copy_kernel_end:
-
/* remove header in source kernel image */
mov r5, #0
str r5, [r0] /* remove 4 bytes header of kernel uImage */
str r5, [r0, #36] /* remove 4 bytes header of kernel zImage */
+skip_copy:
+
/* Returns */
b save_boot_params_ret