Function sbi_rt::nacl_sync_csr

source ·
pub fn nacl_sync_csr(csr_num: usize) -> SbiRet
Expand description

Synchronize CSRs in the nested acceleration shared memory.

This is an optional function that is only available if the SBI_NACL_FEAT_SYNC_CSR feature is available.

§Parameters

The parameter csr_num specifies the set of RISC-V H-extension CSRs to be synchronized.

If csr_num is all-ones bitwise, then all RISC-V H-extension CSRs implemented by the SBI implementation (or L0 hypervisor) are synchronized.

If (csr_num & 0x300) == 0x200 and csr_num < 0x1000 then only a single RISC-V H-extension CSR specified by the csr_num parameter is synchronized.

§Return value

The possible error codes returned in SbiRet.error are shown in the table below:

Error codeDescription
SbiRet::success()CSRs synchronized successfully.
SbiRet::not_supported()SBI_NACL_FEAT_SYNC_CSR feature is not available.
SbiRet::invalid_param()csr_num is not all-ones bitwise and either:
* (csr_num & 0x300) != 0x200 or
* csr_num >= 0x1000 or
* csr_num is not implemented by the SBI implementation
SbiRet::no_shmem()Nested acceleration shared memory not available.

This function is defined in RISC-V SBI Specification chapter 15.7.