Function sbi_rt::pmu_counter_stop
source · pub fn pmu_counter_stop<T>(
counter_idx_base: usize,
counter_idx_mask: usize,
stop_flags: T
) -> SbiRetwhere
T: StopFlags,
Expand description
Stop or disable a set of counters on the calling hart.
§Parameters
The counter_idx_base
and counter_idx_mask
parameters represent the set of counters.
The bit definitions of the stop_flags
parameter are shown in the table below:
Flag Name | Bits | Description |
---|---|---|
SBI_PMU_STOP_FLAG_RESET | 0:0 | Reset the counter to event mapping. |
RESERVED | 1:(XLEN-1) | All non-zero values are reserved for future use. |
§Return value
The possible return error codes returned in SbiRet.error
are shown in the table below:
Return code | Description |
---|---|
SbiRet::success() | counter stopped successfully. |
SbiRet::invalid_param() | some of the counters specified in parameters are invalid. |
SbiRet::already_stopped() | some of the counters specified in parameters are already stopped. |
This function is defined in RISC-V SBI Specification chapter 11.9.