On 25/4/25 17:23, Richard Henderson wrote:
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
target/riscv/cpu.h | 3 +-
target/riscv/csr.c | 226 +++++++++++++++++++++++----------------------
2 files changed, 118 insertions(+), 111 deletions(-)
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 167909c89b..4d41a66d72 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -841,7 +841,8 @@ typedef RISCVException
(*riscv_csr_predicate_fn)(CPURISCVState *env,
typedef RISCVException (*riscv_csr_read_fn)(CPURISCVState *env, int csrno,
target_ulong *ret_value);
typedef RISCVException (*riscv_csr_write_fn)(CPURISCVState *env, int csrno,
- target_ulong new_value);
+ target_ulong new_value,
+ uintptr_t ra);
typedef RISCVException (*riscv_csr_op_fn)(CPURISCVState *env, int csrno,
target_ulong *ret_value,
target_ulong new_value,
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index c52c87faae..6f1f69eba6 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -830,13 +830,15 @@ static RISCVException seed(CPURISCVState *env, int csrno)
}
/* zicfiss CSR_SSP read and write */
-static int read_ssp(CPURISCVState *env, int csrno, target_ulong *val)
+static RISCVException read_ssp(CPURISCVState *env, int csrno,
+ target_ulong *val)
{
*val = env->ssp;
return RISCV_EXCP_NONE;
}
-static int write_ssp(CPURISCVState *env, int csrno, target_ulong val)
+static RISCVException write_ssp(CPURISCVState *env, int csrno,
+ target_ulong val, uintptr_t ra)
I like the RISCVException type correction.
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>