mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
target/riscv: Simplify type conversion for CPURISCVState
Use CPURISCVState as argument directly in riscv_cpu_update_mip and riscv_timer_write_timecmp, since type converts from CPURISCVState to RISCVCPU in many caller of them and then back to CPURISCVState in them. Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-Id: <20230309071329.45932-4-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
99c2f5c42a
commit
bbb9fc2591
7 changed files with 31 additions and 44 deletions
|
@ -133,7 +133,7 @@ static int riscv_pmu_incr_ctr_rv32(RISCVCPU *cpu, uint32_t ctr_idx)
|
|||
/* Generate interrupt only if OF bit is clear */
|
||||
if (!(env->mhpmeventh_val[ctr_idx] & MHPMEVENTH_BIT_OF)) {
|
||||
env->mhpmeventh_val[ctr_idx] |= MHPMEVENTH_BIT_OF;
|
||||
riscv_cpu_update_mip(cpu, MIP_LCOFIP, BOOL_TO_MASK(1));
|
||||
riscv_cpu_update_mip(env, MIP_LCOFIP, BOOL_TO_MASK(1));
|
||||
}
|
||||
} else {
|
||||
counter->mhpmcounterh_val++;
|
||||
|
@ -172,7 +172,7 @@ static int riscv_pmu_incr_ctr_rv64(RISCVCPU *cpu, uint32_t ctr_idx)
|
|||
/* Generate interrupt only if OF bit is clear */
|
||||
if (!(env->mhpmevent_val[ctr_idx] & MHPMEVENT_BIT_OF)) {
|
||||
env->mhpmevent_val[ctr_idx] |= MHPMEVENT_BIT_OF;
|
||||
riscv_cpu_update_mip(cpu, MIP_LCOFIP, BOOL_TO_MASK(1));
|
||||
riscv_cpu_update_mip(env, MIP_LCOFIP, BOOL_TO_MASK(1));
|
||||
}
|
||||
} else {
|
||||
counter->mhpmcounter_val++;
|
||||
|
@ -371,7 +371,7 @@ static void pmu_timer_trigger_irq(RISCVCPU *cpu,
|
|||
/* Generate interrupt only if OF bit is clear */
|
||||
if (!(*mhpmevent_val & of_bit_mask)) {
|
||||
*mhpmevent_val |= of_bit_mask;
|
||||
riscv_cpu_update_mip(cpu, MIP_LCOFIP, BOOL_TO_MASK(1));
|
||||
riscv_cpu_update_mip(env, MIP_LCOFIP, BOOL_TO_MASK(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue