target/riscv: Add the mcountinhibit CSR
commit747a43e818dc36bd50ef98c2b11a7c31ceb810fa
authorAlistair Francis <alistair.francis@wdc.com>
Tue, 18 Jun 2019 01:31:08 +0000 (17 18:31 -0700)
committerPalmer Dabbelt <palmer@sifive.com>
Tue, 25 Jun 2019 10:05:40 +0000 (25 03:05 -0700)
tree13fea576f05a1532b2fdf82824a5791f36431b1c
parent6729dbbd420696fcf69cf2c86bdfc66e072058ce
target/riscv: Add the mcountinhibit CSR

1.11 defines mcountinhibit, which has the same numeric CSR value as
mucounteren from 1.09.1 but has different semantics.  This patch enables
the CSR for 1.11-based targets, which is trivial to implement because
the counters in QEMU never tick (legal according to the spec).

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
[Palmer: Fix counter access semantics, change commit message to indicate
the behavior is fully emulated.]
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
target/riscv/cpu_bits.h
target/riscv/csr.c