diff options
author | Philippe Mathieu-Daudé | 2020-12-14 15:07:13 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé | 2021-01-14 17:13:53 +0100 |
commit | 9bcd41d41fb4fd9efbc2fd657a4a12c614e78412 (patch) | |
tree | 5616edc1766620e63146733e7128231a5f6973ad /target/mips | |
parent | target/mips/mips-defs: Rename ISA_MIPS32R6 as ISA_MIPS_R6 (diff) | |
download | qemu-9bcd41d41fb4fd9efbc2fd657a4a12c614e78412.tar.gz qemu-9bcd41d41fb4fd9efbc2fd657a4a12c614e78412.tar.xz qemu-9bcd41d41fb4fd9efbc2fd657a4a12c614e78412.zip |
target/mips: Inline cpu_state_reset() in mips_cpu_reset()
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201214183739.500368-2-f4bug@amsat.org>
Diffstat (limited to 'target/mips')
-rw-r--r-- | target/mips/cpu.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/target/mips/cpu.c b/target/mips/cpu.c index cb70fb2b9b..77fb7366bf 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -105,10 +105,16 @@ static bool mips_cpu_has_work(CPUState *cs) #include "translate_init.c.inc" -/* TODO QOM'ify CPU reset and remove */ -static void cpu_state_reset(CPUMIPSState *env) +static void mips_cpu_reset(DeviceState *dev) { - CPUState *cs = env_cpu(env); + CPUState *cs = CPU(dev); + MIPSCPU *cpu = MIPS_CPU(cs); + MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(cpu); + CPUMIPSState *env = &cpu->env; + + mcc->parent_reset(dev); + + memset(env, 0, offsetof(CPUMIPSState, end_reset_fields)); /* Reset registers to their default values */ env->CP0_PRid = env->cpu_model->CP0_PRid; @@ -331,20 +337,6 @@ static void cpu_state_reset(CPUMIPSState *env) /* UHI interface can be used to obtain argc and argv */ env->active_tc.gpr[4] = -1; } -} - -static void mips_cpu_reset(DeviceState *dev) -{ - CPUState *s = CPU(dev); - MIPSCPU *cpu = MIPS_CPU(s); - MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(cpu); - CPUMIPSState *env = &cpu->env; - - mcc->parent_reset(dev); - - memset(env, 0, offsetof(CPUMIPSState, end_reset_fields)); - - cpu_state_reset(env); #ifndef CONFIG_USER_ONLY if (kvm_enabled()) { |