xref: /openbmc/linux/arch/s390/boot/boot.h (revision e847c767)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef BOOT_BOOT_H
3 #define BOOT_BOOT_H
4 
5 #include <linux/types.h>
6 
7 #define IPL_START	0x200
8 
9 #ifndef __ASSEMBLY__
10 
11 struct machine_info {
12 	unsigned char has_edat1 : 1;
13 	unsigned char has_edat2 : 1;
14 	unsigned char has_nx : 1;
15 };
16 
17 struct vmlinux_info {
18 	unsigned long default_lma;
19 	unsigned long entry;
20 	unsigned long image_size;	/* does not include .bss */
21 	unsigned long bss_size;		/* uncompressed image .bss size */
22 	unsigned long bootdata_off;
23 	unsigned long bootdata_size;
24 	unsigned long bootdata_preserved_off;
25 	unsigned long bootdata_preserved_size;
26 	unsigned long dynsym_start;
27 	unsigned long rela_dyn_start;
28 	unsigned long rela_dyn_end;
29 	unsigned long amode31_size;
30 	unsigned long init_mm_off;
31 	unsigned long swapper_pg_dir_off;
32 	unsigned long invalid_pg_dir_off;
33 };
34 
35 void startup_kernel(void);
36 unsigned long detect_memory(unsigned long *safe_addr);
37 void mem_detect_set_usable_limit(unsigned long limit);
38 bool is_ipl_block_dump(void);
39 void store_ipl_parmblock(void);
40 unsigned long read_ipl_report(unsigned long safe_addr);
41 void setup_boot_command_line(void);
42 void parse_boot_command_line(void);
43 void verify_facilities(void);
44 void print_missing_facilities(void);
45 void sclp_early_setup_buffer(void);
46 void print_pgm_check_info(void);
47 unsigned long get_random_base(unsigned long safe_addr);
48 void setup_vmem(unsigned long asce_limit);
49 unsigned long vmem_estimate_memory_needs(unsigned long online_mem_total);
50 void __printf(1, 2) decompressor_printk(const char *fmt, ...);
51 void error(char *m);
52 
53 extern struct machine_info machine;
54 
55 /* Symbols defined by linker scripts */
56 extern const char kernel_version[];
57 extern unsigned long memory_limit;
58 extern unsigned long vmalloc_size;
59 extern int vmalloc_size_set;
60 extern int kaslr_enabled;
61 extern char __boot_data_start[], __boot_data_end[];
62 extern char __boot_data_preserved_start[], __boot_data_preserved_end[];
63 extern char _decompressor_syms_start[], _decompressor_syms_end[];
64 extern char _stack_start[], _stack_end[];
65 extern char _end[];
66 extern unsigned char _compressed_start[];
67 extern unsigned char _compressed_end[];
68 extern struct vmlinux_info _vmlinux_info;
69 #define vmlinux _vmlinux_info
70 
71 #define __abs_lowcore_pa(x)	(((unsigned long)(x) - __abs_lowcore) % sizeof(struct lowcore))
72 
73 #endif /* __ASSEMBLY__ */
74 #endif /* BOOT_BOOT_H */
75