Browse Source

Remove no-longer-needed csr_read_only check in validate_csr()

All CSR permissions checks now occur inside the
csr_t::verify_permissions() methods.

This reverts commit 62526773c0.
pull/821/head
Scott Johnson 5 years ago
parent
commit
4245b20c36
No known key found for this signature in database GPG Key ID: 61C1F01D3D1410C9
  1. 6
      riscv/decode.h

6
riscv/decode.h

@ -368,11 +368,7 @@ inline freg_t f128_negate(freg_t a)
#define validate_csr(which, write) ({ \
if (!STATE.serialized) return PC_SERIALIZE_BEFORE; \
STATE.serialized = false; \
/* disallow writes to read-only CSRs */ \
unsigned csr_read_only = get_field((which), 0xC00) == 3; \
if ((write) && csr_read_only) \
throw trap_illegal_instruction(insn.bits()); \
/* other permissions checks occur in get_csr */ \
/* permissions check occurs in get_csr */ \
(which); })
/* For debug only. This will fail if the native machine's float types are not IEEE */

Loading…
Cancel
Save