aboutsummaryrefslogtreecommitdiff
path: root/target/riscv/csr.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2021-08-07 22:10:25 +0800
committerAlistair Francis <alistair.francis@wdc.com>2021-09-01 11:59:12 +1000
commit65e728a28aa6c9df62711e2ece09f142b97825a6 (patch)
tree924f53292e12f05a0ff48109573b3db759bdee24 /target/riscv/csr.c
parent58bde469ba0208497eea49650df7e9f832875e56 (diff)
target/riscv: Correct a comment in riscv_csrrw()
When privilege check fails, RISCV_EXCP_ILLEGAL_INST is returned, not -1 (RISCV_EXCP_NONE). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20210807141025.31808-1-bmeng.cn@gmail.com Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/csr.c')
-rw-r--r--target/riscv/csr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 9a4ed18ac5..e747fbe0e9 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -1423,7 +1423,7 @@ RISCVException riscv_csrrw(CPURISCVState *env, int csrno,
target_ulong old_value;
RISCVCPU *cpu = env_archcpu(env);
- /* check privileges and return -1 if check fails */
+ /* check privileges and return RISCV_EXCP_ILLEGAL_INST if check fails */
#if !defined(CONFIG_USER_ONLY)
int effective_priv = env->priv;
int read_only = get_field(csrno, 0xC00) == 3;