OSDN Git Service

target/riscv: Add some comments to clarify the priority policy of riscv_csrrw_check()
authorBin Meng <bmeng@tinylab.org>
Tue, 28 Feb 2023 10:40:18 +0000 (18:40 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 2 Mar 2023 00:40:11 +0000 (16:40 -0800)
commita5e0f68652fe1ed0231311d6c8aaeaf55c631821
treef29b5c907962d9d28836fb8d6893d63a95630864
parent0bc71ee0b70ba8842cbf919ba4fcfd6a37f8f716
target/riscv: Add some comments to clarify the priority policy of riscv_csrrw_check()

The priority policy of riscv_csrrw_check() was once adjusted in
commit eacaf4401956 ("target/riscv: Fix priority of csr related check in riscv_csrrw_check")
whose commit message says the CSR existence check should come before
the access control check, but the code changes did not agree with
the commit message, that the predicate() check actually came after
the read / write check.

In fact this was intentional. Add some comments there so that people
won't bother trying to change it without a solid reason.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li<liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-3-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
target/riscv/csr.c