diff --git a/qemu/target/arm/cpu.c b/qemu/target/arm/cpu.c index ff8fb705..e034192c 100644 --- a/qemu/target/arm/cpu.c +++ b/qemu/target/arm/cpu.c @@ -2056,15 +2056,15 @@ ARMCPU *cpu_arm_init(struct uc_struct *uc) #if !defined(TARGET_AARCH64) if (uc->mode & UC_MODE_MCLASS) { - uc->cpu_model = 11; + uc->cpu_model = UC_CPU_ARM_CORTEX_M33; } else if (uc->mode & UC_MODE_ARM926) { - uc->cpu_model = 0; + uc->cpu_model = UC_CPU_ARM_926; } else if (uc->mode & UC_MODE_ARM946) { - uc->cpu_model = 1; + uc->cpu_model = UC_CPU_ARM_946; } else if (uc->mode & UC_MODE_ARM1176) { - uc->cpu_model = 5; + uc->cpu_model = UC_CPU_ARM_1176; } else if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 17; // cortex-a15 + uc->cpu_model = UC_CPU_ARM_CORTEX_A15; // cortex-a15 } else if (uc->cpu_model >= ARR_SIZE(arm_cpus)) { free(cpu); return NULL; diff --git a/qemu/target/i386/cpu.c b/qemu/target/i386/cpu.c index 3f1756e5..12953daa 100644 --- a/qemu/target/i386/cpu.c +++ b/qemu/target/i386/cpu.c @@ -5083,9 +5083,9 @@ X86CPU *cpu_x86_init(struct uc_struct *uc) if (uc->cpu_model == INT_MAX) { #ifdef TARGET_X86_64 - uc->cpu_model = 0; // qemu64 + uc->cpu_model = UC_CPU_X86_QEMU64; // qemu64 #else - uc->cpu_model = 4; // qemu32 + uc->cpu_model = UC_CPU_X86_QEMU32; // qemu32 #endif } else if (uc->cpu_model >= ARRAY_SIZE(builtin_x86_defs)) { free(cpu); diff --git a/qemu/target/m68k/cpu.c b/qemu/target/m68k/cpu.c index 8afc0c19..915b82ac 100644 --- a/qemu/target/m68k/cpu.c +++ b/qemu/target/m68k/cpu.c @@ -271,7 +271,7 @@ M68kCPU *cpu_m68k_init(struct uc_struct *uc) } if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 7; // cfv4e + uc->cpu_model = UC_CPU_M68K_CFV4E; // cfv4e } else if (uc->cpu_model >= ARRAY_SIZE(m68k_cpus_type_infos)) { free(cpu); return NULL; diff --git a/qemu/target/mips/cpu.c b/qemu/target/mips/cpu.c index 60fd1b93..4ddf65e0 100644 --- a/qemu/target/mips/cpu.c +++ b/qemu/target/mips/cpu.c @@ -164,14 +164,14 @@ MIPSCPU *cpu_mips_init(struct uc_struct *uc) #ifdef TARGET_MIPS64 if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 17; // R4000 + uc->cpu_model = UC_CPU_MIPS64_R4000; // R4000 } else if (uc->cpu_model + UC_CPU_MIPS32_I7200 + 1 >= mips_defs_number ) { free(cpu); return NULL; } #else if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 10; // 74kf + uc->cpu_model = UC_CPU_MIPS32_74KF; // 74kf } else if (uc->cpu_model >= mips_defs_number) { free(cpu); return NULL; diff --git a/qemu/target/ppc/translate_init.inc.c b/qemu/target/ppc/translate_init.inc.c index 3f40bd60..65956ad1 100644 --- a/qemu/target/ppc/translate_init.inc.c +++ b/qemu/target/ppc/translate_init.inc.c @@ -11149,14 +11149,14 @@ PowerPCCPU *cpu_ppc_init(struct uc_struct *uc) memset(cpu, 0, sizeof(*cpu)); #ifdef TARGET_PPC64 if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 18 + UC_CPU_PPC_7457A_V1_2 + 1; // power10_v1.0 + uc->cpu_model = UC_CPU_PPC_POWER10_V1_0 + UC_CPU_PPC_7457A_V1_2 + 1; // power10_v1.0 } else if (uc->cpu_model + UC_CPU_PPC_7457A_V1_2 + 1 >= ARRAY_SIZE(ppc_cpus)) { free(cpu); return NULL; } #else if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 289; // 7457a_v1.2 + uc->cpu_model = UC_CPU_PPC_7457A_V1_2; // 7457a_v1.2 } else if (uc->cpu_model >= ARRAY_SIZE(ppc_cpus)) { free(cpu); return NULL; diff --git a/qemu/target/riscv/cpu.c b/qemu/target/riscv/cpu.c index 15d9349e..d58204ad 100644 --- a/qemu/target/riscv/cpu.c +++ b/qemu/target/riscv/cpu.c @@ -342,12 +342,12 @@ RISCVCPU *cpu_riscv_init(struct uc_struct *uc) #ifdef TARGET_RISCV32 if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 3; + uc->cpu_model = UC_CPU_RISCV32_SIFIVE_U34; } #else /* TARGET_RISCV64 */ if (uc->cpu_model == INT_MAX) { - uc->cpu_model = 3; + uc->cpu_model = UC_CPU_RISCV64_SIFIVE_U54; } #endif diff --git a/qemu/target/sparc/cpu.c b/qemu/target/sparc/cpu.c index 461d7687..489819bc 100644 --- a/qemu/target/sparc/cpu.c +++ b/qemu/target/sparc/cpu.c @@ -525,9 +525,9 @@ SPARCCPU *cpu_sparc_init(struct uc_struct *uc) if (uc->cpu_model == INT_MAX) { #ifdef TARGET_SPARC64 - uc->cpu_model = 11; // Sun UltraSparc IV + uc->cpu_model = UC_CPU_SPARC64_SUN_ULTRASPARC_IV; // Sun UltraSparc IV #else - uc->cpu_model = 12; // Leon 3 + uc->cpu_model = UC_CPU_SPARC32_LEON3; // Leon 3 #endif } else if (uc->cpu_model >= ARRAY_SIZE(sparc_defs)) { free(cpu);