diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-01-29 17:44:51 +0100 |
|---|---|---|
| committer | Thomas Huth <thuth@redhat.com> | 2024-03-12 11:46:17 +0100 |
| commit | 2db5b94d8343816e99527cf99cf14d090d174ef6 (patch) | |
| tree | a2217dde707aedfc38c65310acdf8a51e71cb67b /target/avr/helper.c | |
| parent | 50cb36ce77906c24dd6f587c636d3d71dd6128f4 (diff) | |
| download | focaccia-qemu-2db5b94d8343816e99527cf99cf14d090d174ef6.tar.gz focaccia-qemu-2db5b94d8343816e99527cf99cf14d090d174ef6.zip | |
target/avr: 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. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240129164514.73104-10-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'target/avr/helper.c')
| -rw-r--r-- | target/avr/helper.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/target/avr/helper.c b/target/avr/helper.c index fdc9884ea0..eeca415c43 100644 --- a/target/avr/helper.c +++ b/target/avr/helper.c @@ -30,8 +30,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { - AVRCPU *cpu = AVR_CPU(cs); - CPUAVRState *env = &cpu->env; + CPUAVRState *env = cpu_env(cs); /* * We cannot separate a skip from the next instruction, @@ -69,8 +68,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request) void avr_cpu_do_interrupt(CPUState *cs) { - AVRCPU *cpu = AVR_CPU(cs); - CPUAVRState *env = &cpu->env; + CPUAVRState *env = cpu_env(cs); uint32_t ret = env->pc_w; int vector = 0; @@ -144,9 +142,7 @@ bool avr_cpu_tlb_fill(CPUState *cs, vaddr address, int size, if (probe) { page_size = 1; } else { - AVRCPU *cpu = AVR_CPU(cs); - CPUAVRState *env = &cpu->env; - env->fullacc = 1; + cpu_env(cs)->fullacc = 1; cpu_loop_exit_restore(cs, retaddr); } } |