2025-04-17 17:59:35 +02:00
|
|
|
/*
|
|
|
|
|
* QEMU target info stubs (target specific)
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) Linaro
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
|
|
|
#include "qemu/target-info.h"
|
2025-03-23 12:47:37 +01:00
|
|
|
#include "qemu/target-info-impl.h"
|
2026-05-14 10:23:01 -07:00
|
|
|
#include "qemu/target-info-init.h"
|
2025-11-27 08:37:19 +01:00
|
|
|
#include "hw/core/boards.h"
|
2025-04-17 17:59:35 +02:00
|
|
|
#include "cpu.h"
|
2026-03-13 05:17:13 +01:00
|
|
|
#include "exec/cpu-defs.h"
|
2026-02-17 19:51:02 +10:00
|
|
|
#include "exec/page-vary.h"
|
2025-04-17 17:59:35 +02:00
|
|
|
|
2025-07-30 15:05:17 -07:00
|
|
|
/* Validate correct placement of CPUArchState. */
|
|
|
|
|
QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) != 0);
|
|
|
|
|
QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) != sizeof(CPUState));
|
|
|
|
|
|
2026-02-17 19:51:02 +10:00
|
|
|
/* Validate target page size, if invariant. */
|
|
|
|
|
#ifndef TARGET_PAGE_BITS_VARY
|
|
|
|
|
QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN);
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-03-23 12:47:37 +01:00
|
|
|
static const TargetInfo target_info_stub = {
|
|
|
|
|
.target_name = TARGET_NAME,
|
2026-02-05 13:06:17 +10:00
|
|
|
.target_arch = glue(SYS_EMU_TARGET_, TARGET_ARCH),
|
2025-03-23 13:20:24 +01:00
|
|
|
.long_bits = TARGET_LONG_BITS,
|
2025-04-29 20:18:03 +02:00
|
|
|
.cpu_type = CPU_RESOLVING_TYPE,
|
2025-03-23 22:46:34 +01:00
|
|
|
.machine_typename = TYPE_MACHINE,
|
2025-07-08 23:53:15 +02:00
|
|
|
.endianness = TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITTLE,
|
2026-02-17 19:51:01 +10:00
|
|
|
#ifdef TARGET_PAGE_BITS_VARY
|
|
|
|
|
.page_bits_vary = true,
|
|
|
|
|
# ifdef TARGET_PAGE_BITS_LEGACY
|
|
|
|
|
.page_bits_init = TARGET_PAGE_BITS_LEGACY,
|
|
|
|
|
# endif
|
|
|
|
|
#else
|
|
|
|
|
.page_bits_vary = false,
|
|
|
|
|
.page_bits_init = TARGET_PAGE_BITS,
|
|
|
|
|
#endif
|
2025-03-23 12:47:37 +01:00
|
|
|
};
|
|
|
|
|
|
2026-05-14 10:23:01 -07:00
|
|
|
target_info_init(target_info_stub)
|