This is for avoid "max-v8" qom name conflict in multi-target qemu
Signed-off-by: Yonggang Luo <[email protected]> --- target/arm/tcg/cpu-max-v8.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/arm/tcg/cpu-max-v8.c b/target/arm/tcg/cpu-max-v8.c index 65f851f2006..d7323ab431c 100644 --- a/target/arm/tcg/cpu-max-v8.c +++ b/target/arm/tcg/cpu-max-v8.c @@ -119,12 +119,21 @@ void aarch32_max_v8_tcg_initfn(Object *obj) #endif } +static void max_v8_tcg_initfn(Object *obj) +{ + if (target_aarch64()) { + aarch64_max_v8_tcg_initfn(obj); + } else { + aarch32_max_v8_tcg_initfn(obj); + } +} + static void cpu_max_v8_register_type(void) { - static const ARMCPUInfo max_v8[2] = { - { .name = "max-v8", .initfn = aarch32_max_v8_tcg_initfn }, - { .name = "max-v8", .initfn = aarch64_max_v8_tcg_initfn }, + static const ARMCPUInfo max_v8 = { + .name = "max-v8", + .initfn = max_v8_tcg_initfn, }; - arm_cpu_register(&max_v8[target_aarch64()]); + arm_cpu_register(&max_v8); } type_init(cpu_max_v8_register_type) -- 2.55.0.windows.3
