1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * Copyright (c) 2011 The Chromium OS Authors.
4 */
5
6 /* Taken from Linux kernel, commit f56c3196 */
7
8 #ifndef _ASM_GENERIC_SECTIONS_H_
9 #define _ASM_GENERIC_SECTIONS_H_
10
11 #include <linux/types.h>
12
13 /* References to section boundaries */
14
15 extern char _text[], _stext[], _etext[];
16 extern char _data[], _sdata[], _edata[];
17 extern char __bss_start[], __bss_stop[];
18 extern char __init_begin[], __init_end[];
19 extern char _sinittext[], _einittext[];
20 extern char _end[], _init[];
21 extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
22 extern char __kprobes_text_start[], __kprobes_text_end[];
23 extern char __entry_text_start[], __entry_text_end[];
24 extern char __initdata_begin[], __initdata_end[];
25 extern char __start_rodata[], __end_rodata[];
26 extern char __start_data[], __end_data[];
27 extern char __efi_helloworld_begin[];
28 extern char __efi_helloworld_end[];
29 extern char __efi_var_file_begin[];
30 extern char __efi_var_file_end[];
31 extern char __efi_capsule_sig_begin[];
32 extern char __efi_capsule_sig_end[];
33
34 /* Private data used by of-platdata devices/uclasses */
35 extern char __priv_data_start[], __priv_data_end[];
36
37 /* Start and end of .ctors section - used for constructor calls. */
38 extern char __ctors_start[], __ctors_end[];
39
40 extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[];
41 extern char __efi_runtime_start[], __efi_runtime_stop[];
42
43 /* function descriptor handling (if any). Override
44 * in asm/sections.h */
45 #ifndef dereference_function_descriptor
46 #define dereference_function_descriptor(p) (p)
47 #endif
48
49 /* random extra sections (if any). Override
50 * in asm/sections.h */
51 #ifndef arch_is_kernel_text
arch_is_kernel_text(unsigned long addr)52 static inline int arch_is_kernel_text(unsigned long addr)
53 {
54 return 0;
55 }
56 #endif
57
58 #ifndef arch_is_kernel_data
arch_is_kernel_data(unsigned long addr)59 static inline int arch_is_kernel_data(unsigned long addr)
60 {
61 return 0;
62 }
63 #endif
64
65 /* U-Boot-specific things begin here */
66
67 /* Start of U-Boot text region */
68 extern char __text_start[];
69 extern char __text_end[];
70
71 /* This marks the text region which must be relocated */
72 extern char __image_copy_start[], __image_copy_end[];
73
74 /* This marks the rcode region used for SPL relocation */
75 extern char _rcode_start[], _rcode_end[];
76
77 extern char __bss_end[];
78 extern char __rel_dyn_start[], __rel_dyn_end[];
79 extern char _image_binary_end[];
80
81 /*
82 * This is the U-Boot entry point - prior to relocation it should be same
83 * as __text_start
84 */
85 extern void _start(void);
86
87 #ifndef USE_HOSTCC
88 #if CONFIG_IS_ENABLED(RELOC_LOADER)
89 #define __rcode __section(".text.rcode")
90 #define __rdata __section(".text.rdata")
91 #else
92 #define __rcode
93 #define __rdata
94 #endif
95 #else
96 #define __rcode
97 #define __rdata
98 #endif
99
100 #endif /* _ASM_GENERIC_SECTIONS_H_ */
101