Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2011 The Chromium OS Authors. |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | /* Taken from Linux kernel, commit f56c3196 */ |
| 7 | |
| 8 | #ifndef _ASM_GENERIC_SECTIONS_H_ |
| 9 | #define _ASM_GENERIC_SECTIONS_H_ |
| 10 | |
Sean Anderson | fbdbf77 | 2019-12-17 21:22:42 -0500 | [diff] [blame] | 11 | #include <linux/types.h> |
| 12 | |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 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[]; |
Simon Glass | a733b06 | 2013-04-26 02:53:43 +0000 | [diff] [blame] | 20 | extern char _end[], _init[]; |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 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[]; |
Heinrich Schuchardt | 5e44489 | 2017-09-05 03:19:37 +0200 | [diff] [blame] | 26 | extern char __efi_helloworld_begin[]; |
| 27 | extern char __efi_helloworld_end[]; |
Heinrich Schuchardt | 7dda163 | 2020-07-14 21:25:28 +0200 | [diff] [blame] | 28 | extern char __efi_var_file_begin[]; |
| 29 | extern char __efi_var_file_end[]; |
Ilias Apalodimas | ddf67da | 2021-07-17 17:26:44 +0300 | [diff] [blame] | 30 | extern char __efi_capsule_sig_begin[]; |
| 31 | extern char __efi_capsule_sig_end[]; |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 32 | |
Simon Glass | baf0371 | 2021-03-15 17:25:38 +1300 | [diff] [blame] | 33 | /* Private data used by of-platdata devices/uclasses */ |
| 34 | extern char __priv_data_start[], __priv_data_end[]; |
| 35 | |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 36 | /* Start and end of .ctors section - used for constructor calls. */ |
| 37 | extern char __ctors_start[], __ctors_end[]; |
| 38 | |
| 39 | /* function descriptor handling (if any). Override |
| 40 | * in asm/sections.h */ |
| 41 | #ifndef dereference_function_descriptor |
| 42 | #define dereference_function_descriptor(p) (p) |
| 43 | #endif |
| 44 | |
| 45 | /* random extra sections (if any). Override |
| 46 | * in asm/sections.h */ |
| 47 | #ifndef arch_is_kernel_text |
| 48 | static inline int arch_is_kernel_text(unsigned long addr) |
| 49 | { |
| 50 | return 0; |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #ifndef arch_is_kernel_data |
| 55 | static inline int arch_is_kernel_data(unsigned long addr) |
| 56 | { |
| 57 | return 0; |
| 58 | } |
| 59 | #endif |
| 60 | |
| 61 | /* U-Boot-specific things begin here */ |
| 62 | |
| 63 | /* Start of U-Boot text region */ |
| 64 | extern char __text_start[]; |
| 65 | |
| 66 | /* This marks the end of the text region which must be relocated */ |
| 67 | extern char __image_copy_end[]; |
| 68 | |
| 69 | /* |
| 70 | * This is the U-Boot entry point - prior to relocation it should be same |
| 71 | * as __text_start |
| 72 | */ |
| 73 | extern void _start(void); |
| 74 | |
| 75 | /* |
Albert ARIBAUD | b60eff3 | 2014-02-22 17:53:43 +0100 | [diff] [blame] | 76 | * ARM defines its symbols as char[]. Other arches define them as ulongs. |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 77 | */ |
| 78 | #ifdef CONFIG_ARM |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 79 | |
Albert ARIBAUD | b60eff3 | 2014-02-22 17:53:43 +0100 | [diff] [blame] | 80 | extern char __bss_start[]; |
| 81 | extern char __bss_end[]; |
| 82 | extern char __image_copy_start[]; |
| 83 | extern char __image_copy_end[]; |
Simon Glass | 1017296 | 2015-10-17 19:41:19 -0600 | [diff] [blame] | 84 | extern char _image_binary_end[]; |
Albert ARIBAUD | b60eff3 | 2014-02-22 17:53:43 +0100 | [diff] [blame] | 85 | extern char __rel_dyn_start[]; |
| 86 | extern char __rel_dyn_end[]; |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 87 | |
| 88 | #else /* don't use offsets: */ |
| 89 | |
| 90 | /* Exports from the Linker Script */ |
| 91 | extern ulong __data_end; |
| 92 | extern ulong __rel_dyn_start; |
| 93 | extern ulong __rel_dyn_end; |
| 94 | extern ulong __bss_end; |
Simon Glass | 22d9574 | 2016-09-25 21:33:05 -0600 | [diff] [blame] | 95 | extern ulong _image_binary_end; |
Simon Glass | 1865286 | 2013-03-05 14:39:37 +0000 | [diff] [blame] | 96 | |
| 97 | extern ulong _TEXT_BASE; /* code start */ |
| 98 | |
| 99 | #endif |
| 100 | |
| 101 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |