Home
last modified time | relevance | path

Searched hist:ca5bd0a25f6892a0c98b182b557c446dce4e580e (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/arch/riscv/include/
H A Driscv.hca5bd0a25f6892a0c98b182b557c446dce4e580e Thu Dec 05 10:06:01 UTC 2024 Huang Borong <huangborong@bosc.ac.cn> core: riscv: Improve macros for set/clear bits CSR operations

Rename `set_csr` to `read_set_csr` and `clear_csr` to `read_clear_csr`
because they perform atomic reads and set/clear bits in the CSR. These
two macros will return the previous value of the CSR.

Introduce new macros `set_csr` and `clear_csr`: `set_csr` uses the
RISC-V `csrs` assembler pseudoinstruction to set bits in the CSR when
the old value is not needed, while `clear_csr` uses the `csrc`
pseudoinstruction to clear bits in the CSR, also discarding the old
value.

Signed-off-by: Huang Borong <huangborong@bosc.ac.cn>
Reviewed-by: Alvin Chang <alvinga@andestech.com>