mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qemu/target-info: Add %target_arch field to TargetInfo
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-Id: <20250708215320.70426-4-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
0af00042a9
commit
536613be40
@@ -9,11 +9,13 @@
|
||||
#ifndef QEMU_TARGET_INFO_IMPL_H
|
||||
#define QEMU_TARGET_INFO_IMPL_H
|
||||
|
||||
#include "qemu/target-info.h"
|
||||
#include "qapi/qapi-types-machine.h"
|
||||
|
||||
typedef struct TargetInfo {
|
||||
/* runtime equivalent of TARGET_NAME definition */
|
||||
const char *target_name;
|
||||
/* related to TARGET_ARCH definition */
|
||||
SysEmuTarget target_arch;
|
||||
/* runtime equivalent of TARGET_LONG_BITS definition */
|
||||
unsigned long_bits;
|
||||
/* runtime equivalent of CPU_RESOLVING_TYPE definition */
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
static const TargetInfo target_info_stub = {
|
||||
.target_name = TARGET_NAME,
|
||||
.target_arch = SYS_EMU_TARGET__MAX,
|
||||
.long_bits = TARGET_LONG_BITS,
|
||||
.cpu_type = CPU_RESOLVING_TYPE,
|
||||
.machine_typename = TYPE_MACHINE,
|
||||
|
||||
+7
-2
@@ -24,8 +24,13 @@ unsigned target_long_bits(void)
|
||||
|
||||
SysEmuTarget target_arch(void)
|
||||
{
|
||||
return qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
|
||||
&error_abort);
|
||||
SysEmuTarget arch = target_info()->target_arch;
|
||||
|
||||
if (arch == SYS_EMU_TARGET__MAX) {
|
||||
arch = qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1,
|
||||
&error_abort);
|
||||
}
|
||||
return arch;
|
||||
}
|
||||
|
||||
const char *target_cpu_type(void)
|
||||
|
||||
Reference in New Issue
Block a user