162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#include <asm/page.h>
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci/*
562306a36Sopenharmony_ci * .boot.data section is shared between the decompressor code and the
662306a36Sopenharmony_ci * decompressed kernel. The decompressor will store values in it, and copy
762306a36Sopenharmony_ci * over to the decompressed image before starting it.
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * .boot.data variables are kept in separate .boot.data.<var name> sections,
1062306a36Sopenharmony_ci * which are sorted by alignment first, then by name before being merged
1162306a36Sopenharmony_ci * into single .boot.data section. This way big holes cased by page aligned
1262306a36Sopenharmony_ci * structs are avoided and linker produces consistent result.
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#define BOOT_DATA							\
1562306a36Sopenharmony_ci	. = ALIGN(PAGE_SIZE);						\
1662306a36Sopenharmony_ci	.boot.data : {							\
1762306a36Sopenharmony_ci		__boot_data_start = .;					\
1862306a36Sopenharmony_ci		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.boot.data*)))		\
1962306a36Sopenharmony_ci		__boot_data_end = .;					\
2062306a36Sopenharmony_ci	}
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/*
2362306a36Sopenharmony_ci * .boot.preserved.data is similar to .boot.data, but it is not part of the
2462306a36Sopenharmony_ci * .init section and thus will be preserved for later use in the decompressed
2562306a36Sopenharmony_ci * kernel.
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_ci#define BOOT_DATA_PRESERVED						\
2862306a36Sopenharmony_ci	. = ALIGN(PAGE_SIZE);						\
2962306a36Sopenharmony_ci	.boot.preserved.data : {					\
3062306a36Sopenharmony_ci		__boot_data_preserved_start = .;			\
3162306a36Sopenharmony_ci		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.boot.preserved.data*))) \
3262306a36Sopenharmony_ci		__boot_data_preserved_end = .;				\
3362306a36Sopenharmony_ci	}
34