Function sbi_rt::hart_get_status

source ·
pub fn hart_get_status(hartid: usize) -> SbiRet
Expand description

Get the current status (or HSM state id) of the given hart.

The harts may transition HSM states at any time due to any concurrent hart_start() or hart_stop() calls, the return value from this function may not represent the actual state of the hart at the time of return value verification.

§Parameters

The hartid parameter specifies the target hart which status is required.

§Return value

The possible status values returned in SbiRet.value are shown in the table below:

NameValueDescription
STARTED0Hart Started
STOPPED1Hart Stopped
START_PENDING2Hart start request pending
STOP_PENDING3Hart stop request pending

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

Error codeDescription
SbiRet::invalid_param()The given hartid is not valid

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