target/rx: 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-24-philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
794511bc51
commit
f2a4459db9
@ -71,9 +71,9 @@ static int riscv_cpu_mmu_index(CPUState *cs, bool ifunc)
|
|||||||
|
|
||||||
static void rx_cpu_reset_hold(Object *obj)
|
static void rx_cpu_reset_hold(Object *obj)
|
||||||
{
|
{
|
||||||
RXCPU *cpu = RX_CPU(obj);
|
CPUState *cs = CPU(obj);
|
||||||
RXCPUClass *rcc = RX_CPU_GET_CLASS(obj);
|
RXCPUClass *rcc = RX_CPU_GET_CLASS(obj);
|
||||||
CPURXState *env = &cpu->env;
|
CPURXState *env = cpu_env(cs);
|
||||||
uint32_t *resetvec;
|
uint32_t *resetvec;
|
||||||
|
|
||||||
if (rcc->parent_phases.hold) {
|
if (rcc->parent_phases.hold) {
|
||||||
|
@ -21,8 +21,7 @@
|
|||||||
|
|
||||||
int rx_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
int rx_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||||
{
|
{
|
||||||
RXCPU *cpu = RX_CPU(cs);
|
CPURXState *env = cpu_env(cs);
|
||||||
CPURXState *env = &cpu->env;
|
|
||||||
|
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0 ... 15:
|
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)
|
int rx_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||||
{
|
{
|
||||||
RXCPU *cpu = RX_CPU(cs);
|
CPURXState *env = cpu_env(cs);
|
||||||
CPURXState *env = &cpu->env;
|
|
||||||
uint32_t psw;
|
uint32_t psw;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
case 0 ... 15:
|
case 0 ... 15:
|
||||||
|
@ -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)
|
#define INT_FLAGS (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR)
|
||||||
void rx_cpu_do_interrupt(CPUState *cs)
|
void rx_cpu_do_interrupt(CPUState *cs)
|
||||||
{
|
{
|
||||||
RXCPU *cpu = RX_CPU(cs);
|
CPURXState *env = cpu_env(cs);
|
||||||
CPURXState *env = &cpu->env;
|
|
||||||
int do_irq = cs->interrupt_request & INT_FLAGS;
|
int do_irq = cs->interrupt_request & INT_FLAGS;
|
||||||
uint32_t save_psw;
|
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)
|
bool rx_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
|
||||||
{
|
{
|
||||||
RXCPU *cpu = RX_CPU(cs);
|
CPURXState *env = cpu_env(cs);
|
||||||
CPURXState *env = &cpu->env;
|
|
||||||
int accept = 0;
|
int accept = 0;
|
||||||
/* hardware interrupt (Normal) */
|
/* hardware interrupt (Normal) */
|
||||||
if ((interrupt_request & CPU_INTERRUPT_HARD) &&
|
if ((interrupt_request & CPU_INTERRUPT_HARD) &&
|
||||||
|
@ -131,8 +131,7 @@ static int bdsp_s(DisasContext *ctx, int d)
|
|||||||
|
|
||||||
void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
void rx_cpu_dump_state(CPUState *cs, FILE *f, int flags)
|
||||||
{
|
{
|
||||||
RXCPU *cpu = RX_CPU(cs);
|
CPURXState *env = cpu_env(cs);
|
||||||
CPURXState *env = &cpu->env;
|
|
||||||
int i;
|
int i;
|
||||||
uint32_t psw;
|
uint32_t psw;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user