diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-29 17:45:00 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-03-12 12:04:24 +0100 |
commit | 4c44a9805127d8f6f065d40fd9f9c65fcf75bcc2 (patch) | |
tree | 2248f4de779c6e3bc2186cf6f4021191eb7d69a1 /target/mips/tcg/sysemu | |
parent | da9536433fe9d35363fea26cee7f2de93c007ec2 (diff) | |
download | qemu-4c44a9805127d8f6f065d40fd9f9c65fcf75bcc2.zip qemu-4c44a9805127d8f6f065d40fd9f9c65fcf75bcc2.tar.gz qemu-4c44a9805127d8f6f065d40fd9f9c65fcf75bcc2.tar.bz2 |
target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro
Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240129164514.73104-19-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'target/mips/tcg/sysemu')
-rw-r--r-- | target/mips/tcg/sysemu/special_helper.c | 3 | ||||
-rw-r--r-- | target/mips/tcg/sysemu/tlb_helper.c | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/target/mips/tcg/sysemu/special_helper.c b/target/mips/tcg/sysemu/special_helper.c index 518d3fb..5baa253 100644 --- a/target/mips/tcg/sysemu/special_helper.c +++ b/target/mips/tcg/sysemu/special_helper.c @@ -90,8 +90,7 @@ static void debug_post_eret(CPUMIPSState *env) bool mips_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb) { - MIPSCPU *cpu = MIPS_CPU(cs); - CPUMIPSState *env = &cpu->env; + CPUMIPSState *env = cpu_env(cs); if ((env->hflags & MIPS_HFLAG_BMASK) != 0 && !(cs->tcg_cflags & CF_PCREL) && env->active_tc.PC != tb->pc) { diff --git a/target/mips/tcg/sysemu/tlb_helper.c b/target/mips/tcg/sysemu/tlb_helper.c index cdae42f..119eae7 100644 --- a/target/mips/tcg/sysemu/tlb_helper.c +++ b/target/mips/tcg/sysemu/tlb_helper.c @@ -906,8 +906,7 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, bool probe, uintptr_t retaddr) { - MIPSCPU *cpu = MIPS_CPU(cs); - CPUMIPSState *env = &cpu->env; + CPUMIPSState *env = cpu_env(cs); hwaddr physical; int prot; int ret = TLBRET_BADADDR; @@ -1340,8 +1339,7 @@ void mips_cpu_do_interrupt(CPUState *cs) bool mips_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { if (interrupt_request & CPU_INTERRUPT_HARD) { - MIPSCPU *cpu = MIPS_CPU(cs); - CPUMIPSState *env = &cpu->env; + CPUMIPSState *env = cpu_env(cs); if (cpu_mips_hw_interrupts_enabled(env) && cpu_mips_hw_interrupts_pending(env)) { |