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:
Name | Value | Description |
---|---|---|
STARTED | 0 | Hart Started |
STOPPED | 1 | Hart Stopped |
START_PENDING | 2 | Hart start request pending |
STOP_PENDING | 3 | Hart stop request pending |
The possible return error codes returned in SbiRet.error
are shown in the table below:
Error code | Description |
---|---|
SbiRet::invalid_param() | The given hartid is not valid |
This function is defined in RISC-V SBI Specification chapter 9.3.