Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: riscv: Fix logic of thread_{get/set}_exceptions()
In ARM, the bits in DAIF register are used to mask the interrupts. While in RISC-V, the bits in CSR mie/sie are used to enable(unmask) corresponding interrupt sources. To not modify the function of thread_get_exceptions(), we invert the bits after reading the value of CSR mie/sie, as mask. To not modify the function of thread_set_exceptions(), we invert the bits in given "exceptions" before writing "exceptions" into CSR mie/sie. Therefore, the intended masked exception bits will be cleared when we write the final value into CSR mie/sie to mask those interrupts. Signed-off-by: Alvin Chang <alvinga@andestech.com>
- Loading branch information