xref: /openbmc/linux/arch/s390/include/asm/sections.h (revision bef7a78d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _S390_SECTIONS_H
3 #define _S390_SECTIONS_H
4 
5 #define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed
6 
7 #include <asm-generic/sections.h>
8 
9 extern bool initmem_freed;
10 
11 static inline int arch_is_kernel_initmem_freed(unsigned long addr)
12 {
13 	if (!initmem_freed)
14 		return 0;
15 	return addr >= (unsigned long)__init_begin &&
16 	       addr < (unsigned long)__init_end;
17 }
18 
19 /*
20  * .boot.data section contains variables "shared" between the decompressor and
21  * the decompressed kernel. The decompressor will store values in them, and
22  * copy over to the decompressed image before starting it.
23  *
24  * Each variable end up in its own intermediate section .boot.data.<var name>,
25  * those sections are later sorted by alignment + name and merged together into
26  * final .boot.data section, which should be identical in the decompressor and
27  * the decompressed kernel (that is checked during the build).
28  */
29 #define __bootdata(var) __section(".boot.data." #var) var
30 
31 /*
32  * .boot.preserved.data is similar to .boot.data, but it is not part of the
33  * .init section and thus will be preserved for later use in the decompressed
34  * kernel.
35  */
36 #define __bootdata_preserved(var) __section(".boot.preserved.data." #var) var
37 
38 extern unsigned long __sdma, __edma;
39 extern unsigned long __stext_dma, __etext_dma;
40 
41 #endif
42