Use TARGET_ARCH and token pasting to initialize
target_arch from SYS_EMU_TARGET_*.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <
20260205030617.266625-4-richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
static const TargetInfo target_info_stub = {
.target_name = TARGET_NAME,
- .target_arch = SYS_EMU_TARGET__MAX,
+ .target_arch = glue(SYS_EMU_TARGET_, TARGET_ARCH),
.long_bits = TARGET_LONG_BITS,
.cpu_type = CPU_RESOLVING_TYPE,
.machine_typename = TYPE_MACHINE,
SysEmuTarget target_arch(void)
{
- 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;
+ return target_info()->target_arch;
}
const char *target_cpu_type(void)