^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * .boot.data section is shared between the decompressor code and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * decompressed kernel. The decompressor will store values in it, and copy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * over to the decompressed image before starting it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * .boot.data variables are kept in separate .boot.data.<var name> sections,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * which are sorted by alignment first, then by name before being merged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * into single .boot.data section. This way big holes cased by page aligned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * structs are avoided and linker produces consistent result.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define BOOT_DATA \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) . = ALIGN(PAGE_SIZE); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) .boot.data : { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) __boot_data_start = .; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.boot.data*))) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) __boot_data_end = .; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * .boot.preserved.data is similar to .boot.data, but it is not part of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * .init section and thus will be preserved for later use in the decompressed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define BOOT_DATA_PRESERVED \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) . = ALIGN(PAGE_SIZE); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) .boot.preserved.data : { \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __boot_data_preserved_start = .; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.boot.preserved.data*))) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) __boot_data_preserved_end = .; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) }