1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/string.h>
5 #include "compressed/decompressor.h"
8 extern char __boot_data_start
[], __boot_data_end
[];
12 sclp_early_printk("\n\n");
14 sclp_early_printk("\n\n -- System halted");
16 disabled_wait(0xdeadbeef);
19 #ifdef CONFIG_KERNEL_UNCOMPRESSED
20 unsigned long mem_safe_offset(void)
22 return vmlinux
.default_lma
+ vmlinux
.image_size
+ vmlinux
.bss_size
;
26 static void rescue_initrd(void)
28 unsigned long min_initrd_addr
;
30 if (!IS_ENABLED(CONFIG_BLK_DEV_INITRD
))
32 if (!INITRD_START
|| !INITRD_SIZE
)
34 min_initrd_addr
= mem_safe_offset();
35 if (min_initrd_addr
<= INITRD_START
)
37 memmove((void *)min_initrd_addr
, (void *)INITRD_START
, INITRD_SIZE
);
38 INITRD_START
= min_initrd_addr
;
41 static void copy_bootdata(void)
43 if (__boot_data_end
- __boot_data_start
!= vmlinux
.bootdata_size
)
44 error(".boot.data section size mismatch");
45 memcpy((void *)vmlinux
.bootdata_off
, __boot_data_start
, vmlinux
.bootdata_size
);
48 void startup_kernel(void)
53 sclp_early_read_info();
54 store_ipl_parmblock();
55 setup_boot_command_line();
58 if (!IS_ENABLED(CONFIG_KERNEL_UNCOMPRESSED
)) {
59 img
= decompress_kernel();
60 memmove((void *)vmlinux
.default_lma
, img
, vmlinux
.image_size
);