You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Section 3.8.7 "Next Interrupt Handler Address and Interrupt-Enable CSR"
It seems like the use of CSRRS was added after the text was written, leading to some inconsistencies.
text refers to "mstatus CSR is used for the RMW portion of the operation" but the CSRRS example only affects the bottom 5 bits of mstatus.
text refers to "must have a level greater than the saved interrupt level mcause.mpil" but the CSRRS example does not check this value, and instead uses rs1[23:16]. Maybe this is intentional but there is no explanation...
It seems weird that CSRRS is permitted but not CSRRC.
Similarly weird, the CSRRSI immediate cannot include non-zero immediate values for bits 0, 2, and 4 but no such restriction applies to CSRRS or CSRRCI.
Perhaps it would be helpful to be more explicit, say "mie and sie bits of the mstatus CSR are used for the RMW portion of the operation; no other bits may be set in the CSRRS/I or CSRRC/I operand"
It may be useful to describe in the conditions for a "suitable" pending interrupt, that those tests are independent of global interrupt enable (which appears to be the case, by inference from the example interrupt handler code in the SW section).
The text was updated successfully, but these errors were encountered:
text refers to "must have a level greater than the saved interrupt level mcause.mpil" but the CSRRS example does not check this value, and instead uses rs1[23:16]. Maybe this is intentional but there is no explanation...
I also would like to know the use-case of csrrs rd, xnxti, rs1 (rs1 != x0). All of sample codes in Appendix use only csrrsi/csrrci xnxti.
The use-case for csrrs rd, xnxti, x0 is described:
This can be used to determine if an interrupt could be taken without actually updating mil and exccode.
But in this case mcause.mpil should be used instead of x0[23:16]. Pseudo-code for this is very simple and easy to implement by reusing logic for csrrsi/csrrci xnxti.
Regarding the definition of xnxti CSR, several inconsistencies have been pointed out in riscv#395, riscv#415, riscv#433, and riscv#434.
This PR attempts to resolve them.
Signed-off-by: Hiroo HAYASHI <[email protected]>
Section 3.8.7 "Next Interrupt Handler Address and Interrupt-Enable CSR"
It seems like the use of CSRRS was added after the text was written, leading to some inconsistencies.
Perhaps it would be helpful to be more explicit, say "mie and sie bits of the mstatus CSR are used for the RMW portion of the operation; no other bits may be set in the CSRRS/I or CSRRC/I operand"
It may be useful to describe in the conditions for a "suitable" pending interrupt, that those tests are independent of global interrupt enable (which appears to be the case, by inference from the example interrupt handler code in the SW section).
The text was updated successfully, but these errors were encountered: