diff --git a/qemu/header_gen.py b/qemu/header_gen.py index 51f13dec..4fa20500 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -3510,6 +3510,7 @@ mips_symbols = ( 'cpu_mips_kseg0_to_phys', 'cpu_mips_kvm_um_phys_to_kseg0', 'cpu_mips_phys_to_kseg0', + 'cpu_mips_realize_env', 'cpu_mips_start_count', 'cpu_mips_stop_count', 'cpu_mips_store_cause', diff --git a/qemu/mips.h b/qemu/mips.h index 7785e156..81c9f208 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -3444,6 +3444,7 @@ #define cpu_mips_kseg0_to_phys cpu_mips_kseg0_to_phys_mips #define cpu_mips_kvm_um_phys_to_kseg0 cpu_mips_kvm_um_phys_to_kseg0_mips #define cpu_mips_phys_to_kseg0 cpu_mips_phys_to_kseg0_mips +#define cpu_mips_realize_env cpu_mips_realize_env_mips #define cpu_mips_start_count cpu_mips_start_count_mips #define cpu_mips_stop_count cpu_mips_stop_count_mips #define cpu_mips_store_cause cpu_mips_store_cause_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index cc14e4bc..549d9aff 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -3444,6 +3444,7 @@ #define cpu_mips_kseg0_to_phys cpu_mips_kseg0_to_phys_mips64 #define cpu_mips_kvm_um_phys_to_kseg0 cpu_mips_kvm_um_phys_to_kseg0_mips64 #define cpu_mips_phys_to_kseg0 cpu_mips_phys_to_kseg0_mips64 +#define cpu_mips_realize_env cpu_mips_realize_env_mips64 #define cpu_mips_start_count cpu_mips_start_count_mips64 #define cpu_mips_stop_count cpu_mips_stop_count_mips64 #define cpu_mips_store_cause cpu_mips_store_cause_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index ef5368ab..576fbb0b 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -3444,6 +3444,7 @@ #define cpu_mips_kseg0_to_phys cpu_mips_kseg0_to_phys_mips64el #define cpu_mips_kvm_um_phys_to_kseg0 cpu_mips_kvm_um_phys_to_kseg0_mips64el #define cpu_mips_phys_to_kseg0 cpu_mips_phys_to_kseg0_mips64el +#define cpu_mips_realize_env cpu_mips_realize_env_mips64el #define cpu_mips_start_count cpu_mips_start_count_mips64el #define cpu_mips_stop_count cpu_mips_stop_count_mips64el #define cpu_mips_store_cause cpu_mips_store_cause_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index bbc79978..7bfa5a3a 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -3444,6 +3444,7 @@ #define cpu_mips_kseg0_to_phys cpu_mips_kseg0_to_phys_mipsel #define cpu_mips_kvm_um_phys_to_kseg0 cpu_mips_kvm_um_phys_to_kseg0_mipsel #define cpu_mips_phys_to_kseg0 cpu_mips_phys_to_kseg0_mipsel +#define cpu_mips_realize_env cpu_mips_realize_env_mipsel #define cpu_mips_start_count cpu_mips_start_count_mipsel #define cpu_mips_stop_count cpu_mips_stop_count_mipsel #define cpu_mips_store_cause cpu_mips_store_cause_mipsel diff --git a/qemu/target/mips/internal.h b/qemu/target/mips/internal.h index 99a77b29..b65e164d 100644 --- a/qemu/target/mips/internal.h +++ b/qemu/target/mips/internal.h @@ -132,6 +132,7 @@ void mips_tcg_init(struct uc_struct *uc); /* TODO QOM'ify CPU reset and remove */ void cpu_state_reset(CPUMIPSState *s); +void cpu_mips_realize_env(CPUMIPSState *env); /* cp0_timer.c */ uint32_t cpu_mips_get_random(CPUMIPSState *env); diff --git a/qemu/target/mips/translate.c b/qemu/target/mips/translate.c index 2135ab4d..0c1f0037 100644 --- a/qemu/target/mips/translate.c +++ b/qemu/target/mips/translate.c @@ -20716,6 +20716,17 @@ void mips_tcg_init(struct uc_struct *uc) #include "translate_init.c" +void cpu_mips_realize_env(CPUMIPSState *env) +{ + env->exception_base = (int32_t)0xBFC00000; + +#ifndef CONFIG_USER_ONLY + mmu_init(env, env->cpu_model); +#endif + fpu_init(env, env->cpu_model); + mvp_init(env, env->cpu_model); +} + MIPSCPU *cpu_mips_init(struct uc_struct *uc, const char *cpu_model) { MIPSCPU *cpu; @@ -20728,13 +20739,8 @@ MIPSCPU *cpu_mips_init(struct uc_struct *uc, const char *cpu_model) cpu = MIPS_CPU(uc, object_new(uc, TYPE_MIPS_CPU)); env = &cpu->env; env->cpu_model = def; - env->exception_base = (int32_t)0xBFC00000; -#ifndef CONFIG_USER_ONLY - mmu_init(env, def); -#endif - fpu_init(env, def); - mvp_init(env, def); + cpu_mips_realize_env(env); object_property_set_bool(uc, OBJECT(cpu), true, "realized", NULL);