master
c 45 lines 1.22 KB
Raw
1 /*
2 * QEMU target info stubs (target specific)
3 *
4 * Copyright (c) Linaro
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9 #include "qemu/osdep.h"
10 #include "qemu/target-info.h"
11 #include "qemu/target-info-impl.h"
12 #include "qemu/target-info-init.h"
13 #include "hw/core/boards.h"
14 #include "cpu.h"
15 #include "exec/cpu-defs.h"
16 #include "exec/page-vary.h"
17
18 /* Validate correct placement of CPUArchState. */
19 QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
20 QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
21
22 /* Validate target page size, if invariant. */
23 #ifndef TARGET_PAGE_BITS_VARY
24 QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
25 #endif
26
27 static const TargetInfo target_info_stub = {
28 .target_name = TARGET_NAME,
29 .target_arch = glue(SYS_EMU_TARGET_, TARGET_ARCH),
30 .long_bits = TARGET_LONG_BITS,
31 .cpu_type = CPU_RESOLVING_TYPE,
32 .machine_typename = TYPE_MACHINE,
33 .endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
34 #ifdef TARGET_PAGE_BITS_VARY
35 .page_bits_vary = true,
36 # ifdef TARGET_PAGE_BITS_LEGACY
37 .page_bits_init = TARGET_PAGE_BITS_LEGACY,
38 # endif
39 #else
40 .page_bits_vary = false,
41 .page_bits_init = TARGET_PAGE_BITS,
42 #endif
43 };
44
45 target_info_init(target_info_stub)