Function sbi_rt::nacl_set_shmem

source ·
pub fn nacl_set_shmem(shmem: SharedPtr<[u8; 12288]>, flags: usize) -> SbiRet
Expand description

Set and enable the shared memory for nested acceleration on the calling hart.

This is a mandatory function of the SBI nested acceleration extension.

§Parameters

If shmem parameter is not all-ones bitwise, then shmem specifies the shared memory physical base address. shmem MUST be 4096 bytes (i.e., page) aligned, and the size of the shared memory must be 4096 + (XLEN * 128) bytes.

If shmem parameter is all-ones bitwise, then the nested acceleration features are disabled.

The flags parameter is reserved for future use and must be zero.

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

Error codeDescription
SbiRet::success()Shared memory was set or cleared successfully.
SbiRet::invalid_param()The flags parameter is not zero or or the shmem parameter is not 4096 bytes aligned.
SbiRet::invalid_address()The shared memory pointed to by the shmem parameters does not satisfy the requirements.

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