[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 50/55] target/rx: Prefer fast cpu_env() over slower CPU QOM cast m
From: |
Thomas Huth |
Subject: |
[PULL 50/55] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro |
Date: |
Tue, 12 Mar 2024 13:43:34 +0100 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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-24-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/rx/cpu.c | 4 ++--
target/rx/gdbstub.c | 6 ++----
target/rx/helper.c | 6 ++----
target/rx/translate.c | 3 +--
4 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/target/rx/cpu.c b/target/rx/cpu.c
index 26ff822e71..da673a595d 100644
--- a/target/rx/cpu.c
+++ b/target/rx/cpu.c
@@ -71,9 +71,9 @@ static int riscv_cpu_mmu_index(CPUState *cs, bool ifunc)
static void rx_cpu_reset_hold(Object *obj)
{
- RXCPU *cpu = RX_CPU(obj);
+ CPUState *cs = CPU(obj);
RXCPUClass *rcc = RX_CPU_GET_CLASS(obj);
- CPURXState *env = &cpu->env;
+ CPURXState *env = cpu_env(cs);
uint32_t *resetvec;
if (rcc->parent_phases.hold) {
diff --git a/target/rx/gdbstub.c b/target/rx/gdbstub.c
index d7e0e6689b..f222bf003b 100644
--- a/target/rx/gdbstub.c
+++ b/target/rx/gdbstub.c
@@ -21,8 +21,7 @@
int rx_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
{
- RXCPU *cpu = RX_CPU(cs);
- CPURXState *env = &cpu->env;
+ CPURXState *env = cpu_env(cs);
switch (n) {
case 0 ... 15:
@@ -53,8 +52,7 @@ int rx_cpu_gdb_read_register(CPUState *cs, GByteArray
*mem_buf, int n)
int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
{
- RXCPU *cpu = RX_CPU(cs);
- CPURXState *env = &cpu->env;
+ CPURXState *env = cpu_env(cs);
uint32_t psw;
switch (n) {
case 0 ... 15:
diff --git a/target/rx/helper.c b/target/rx/helper.c
index dad5fb4976..80912e8dcb 100644
--- a/target/rx/helper.c
+++ b/target/rx/helper.c
@@ -45,8 +45,7 @@ void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte)
#define INT_FLAGS (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR)
void rx_cpu_do_interrupt(CPUState *cs)
{
- RXCPU *cpu = RX_CPU(cs);
- CPURXState *env = &cpu->env;
+ CPURXState *env = cpu_env(cs);
int do_irq = cs->interrupt_request & INT_FLAGS;
uint32_t save_psw;
@@ -122,8 +121,7 @@ void rx_cpu_do_interrupt(CPUState *cs)
bool rx_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
- RXCPU *cpu = RX_CPU(cs);
- CPURXState *env = &cpu->env;
+ CPURXState *env = cpu_env(cs);
int accept = 0;
/* hardware interrupt (Normal) */
if ((interrupt_request & CPU_INTERRUPT_HARD) &&
diff --git a/target/rx/translate.c b/target/rx/translate.c
index f6bf68e00e..f6e9e0ec90 100644
--- a/target/rx/translate.c
+++ b/target/rx/translate.c
@@ -131,8 +131,7 @@ static int bdsp_s(DisasContext *ctx, int d)
void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags)
{
- RXCPU *cpu = RX_CPU(cs);
- CPURXState *env = &cpu->env;
+ CPURXState *env = cpu_env(cs);
int i;
uint32_t psw;
--
2.44.0
- [PULL 45/55] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro, (continued)
- [PULL 45/55] target/microblaze: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 47/55] target/nios2: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 39/55] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 51/55] target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 40/55] target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 37/55] target: Replace CPU_GET_CLASS(cpu -> obj) in cpu_reset_hold() handler, Thomas Huth, 2024/03/12
- [PULL 44/55] target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 42/55] target/i386/hvf: Use CPUState typedef, Thomas Huth, 2024/03/12
- [PULL 48/55] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 49/55] target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 50/55] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro,
Thomas Huth <=
- [PULL 52/55] target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 55/55] user: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 29/55] hw/virtio/vhost: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 33/55] error: Move ERRP_GUARD() to the beginning of the function, Thomas Huth, 2024/03/12
- [PULL 32/55] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 53/55] target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 54/55] target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- Re: [PULL 00/55] Misc ERRP_GUARD() and cpu_env() patches, Peter Maydell, 2024/03/12