Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _S390_SECTIONS_H |
| 3 | #define _S390_SECTIONS_H |
| 4 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 5 | #define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed |
| 6 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 7 | #include <asm-generic/sections.h> |
| 8 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 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 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 41 | #endif |