diff options
author | Nelson Chu <nelson.chu@sifive.com> | 2020-02-12 02:18:51 -0800 |
---|---|---|
committer | Jim Wilson <jimw@sifive.com> | 2020-02-20 16:49:09 -0800 |
commit | 54b2aec10df9ad032184c556ec9cc3f611a91830 (patch) | |
tree | b8a42a4500cd3a7faf247ab0ef07789ab2b4628f /gold/freebsd.h | |
parent | 2ca89224b1ce2cf170bb891b211bede4f6eda473 (diff) | |
download | gdb-54b2aec10df9ad032184c556ec9cc3f611a91830.zip gdb-54b2aec10df9ad032184c556ec9cc3f611a91830.tar.gz gdb-54b2aec10df9ad032184c556ec9cc3f611a91830.tar.bz2 |
RISC-V: Support the read-only CSR checking.
CSRRW and CSRRWI always write CSR. CSRRS, CSRRC, CSRRSI and CSRRCI write CSR
when RS1 isn't zero. The CSR is read only if the [11:10] bits of CSR address
is 0x3. The read-only CSR can not be written by the CSR instructions.
gas/
* config/tc-riscv.c (riscv_ip): New boolean insn_with_csr to indicate
we are assembling instruction with CSR. Call riscv_csr_read_only_check
after parsing all arguments.
(enum csr_insn_type): New enum is used to classify the CSR instruction.
(riscv_csr_insn_type, riscv_csr_read_only_check): New functions. These
are used to check if we write a read-only CSR by the CSR instruction.
* testsuite/gas/riscv/priv-reg-fail-read-only-01.s: New testcase. Test
all CSR for the read-only CSR checking.
* testsuite/gas/riscv/priv-reg-fail-read-only-01.d: Likewise.
* testsuite/gas/riscv/priv-reg-fail-read-only-01.l: Likewise.
* testsuite/gas/riscv/priv-reg-fail-read-only-02.s: New testcase. Test
all CSR instructions for the read-only CSR checking.
* testsuite/gas/riscv/priv-reg-fail-read-only-02.d: Likewise.
* testsuite/gas/riscv/priv-reg-fail-read-only-02.l: Likewise.
Diffstat (limited to 'gold/freebsd.h')
0 files changed, 0 insertions, 0 deletions