xref: /openbmc/u-boot/arch/x86/lib/asm-offsets.c (revision e8f80a5a)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
2254d68b6SMasahiro Yamada /*
3254d68b6SMasahiro Yamada  * Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
4254d68b6SMasahiro Yamada  *
5254d68b6SMasahiro Yamada  * This program is used to generate definitions needed by
6254d68b6SMasahiro Yamada  * assembly language modules.
7254d68b6SMasahiro Yamada  *
8254d68b6SMasahiro Yamada  * We use the technique used in the OSF Mach kernel code:
9254d68b6SMasahiro Yamada  * generate asm statements containing #defines,
10254d68b6SMasahiro Yamada  * compile this file to assembler, and then extract the
11254d68b6SMasahiro Yamada  * #defines from the assembly-language output.
12254d68b6SMasahiro Yamada  */
13254d68b6SMasahiro Yamada 
14254d68b6SMasahiro Yamada #include <common.h>
15254d68b6SMasahiro Yamada #include <linux/kbuild.h>
16254d68b6SMasahiro Yamada 
main(void)17254d68b6SMasahiro Yamada int main(void)
18254d68b6SMasahiro Yamada {
19fe0c33a5SBin Meng 	DEFINE(GD_BIST, offsetof(gd_t, arch.bist));
20bceb9f0fSBin Meng #ifdef CONFIG_HAVE_FSP
21bceb9f0fSBin Meng 	DEFINE(GD_HOB_LIST, offsetof(gd_t, arch.hob_list));
22bceb9f0fSBin Meng #endif
2342fde305SSimon Glass 	DEFINE(GD_TABLE, offsetof(gd_t, arch.table));
24254d68b6SMasahiro Yamada 	return 0;
25254d68b6SMasahiro Yamada }
26