Function pmu_counter_fw_read

Source
pub fn pmu_counter_fw_read(counter_idx: usize) -> SbiRet
Expand description

Provide the current value of a firmware counter.

On RV32 systems, the SbiRet.value will only contain the lower 32 bits from the current value of the firmware counter.

§Parameters

This function should be only used to read a firmware counter. It will return an error when a user provides a hardware counter in counter_idx parameter.

§Return value

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

Return codeDescription
SbiRet::success()firmware counter read successfully.
SbiRet::invalid_param()counter_idx points to a hardware counter or an invalid counter.

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