[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 15/23] target/openrisc: Prefer fast cpu_env() over slower CPU
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 15/23] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro |
Date: |
Fri, 26 Jan 2024 23:03:57 +0100 |
Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/openrisc/gdbstub.c | 3 +--
target/openrisc/interrupt.c | 6 ++----
target/openrisc/translate.c | 3 +--
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/target/openrisc/gdbstub.c b/target/openrisc/gdbstub.c
index d1074a0581..0cce8d4f92 100644
--- a/target/openrisc/gdbstub.c
+++ b/target/openrisc/gdbstub.c
@@ -23,8 +23,7 @@
int openrisc_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
{
- OpenRISCCPU *cpu = OPENRISC_CPU(cs);
- CPUOpenRISCState *env = &cpu->env;
+ CPUOpenRISCState *env = cpu_env(cs);
if (n < 32) {
return gdb_get_reg32(mem_buf, cpu_get_gpr(env, n));
diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c
index d4fdb8ce8e..b3b5b40577 100644
--- a/target/openrisc/interrupt.c
+++ b/target/openrisc/interrupt.c
@@ -29,8 +29,7 @@
void openrisc_cpu_do_interrupt(CPUState *cs)
{
- OpenRISCCPU *cpu = OPENRISC_CPU(cs);
- CPUOpenRISCState *env = &cpu->env;
+ CPUOpenRISCState *env = cpu_env(cs);
int exception = cs->exception_index;
env->epcr = env->pc;
@@ -105,8 +104,7 @@ void openrisc_cpu_do_interrupt(CPUState *cs)
bool openrisc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
- OpenRISCCPU *cpu = OPENRISC_CPU(cs);
- CPUOpenRISCState *env = &cpu->env;
+ CPUOpenRISCState *env = cpu_env(cs);
int idx = -1;
if ((interrupt_request & CPU_INTERRUPT_HARD) && (env->sr & SR_IEE)) {
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index ecff4412b7..aff53c0065 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -1668,8 +1668,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
*tb, int *max_insns,
void openrisc_cpu_dump_state(CPUState *cs, FILE *f, int flags)
{
- OpenRISCCPU *cpu = OPENRISC_CPU(cs);
- CPUOpenRISCState *env = &cpu->env;
+ CPUOpenRISCState *env = cpu_env(cs);
int i;
qemu_fprintf(f, "PC=%08x\n", env->pc);
--
2.41.0
- [PATCH v2 09/23] target/i386/hvf: Use CPUState typedef, (continued)
- [PATCH v2 09/23] target/i386/hvf: Use CPUState typedef, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 10/23] target/i386: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 11/23] target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 12/23] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 14/23] target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 15/23] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro,
Philippe Mathieu-Daudé <=
- [PATCH v2 13/23] target/mips: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 17/23] target/riscv: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 16/23] target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 19/23] target/s390x: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 21/23] target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 18/23] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 20/23] target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26
- [PATCH v2 22/23] target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro, Philippe Mathieu-Daudé, 2024/01/26