mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: sbi_pmu: Firmware counters are always 64 bits wide
As-per SBI specification, all firmware counters are always 64 bits wide so let us update the SBI PMU implementation to reflect this fact. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
This commit is contained in:
@@ -36,7 +36,7 @@ struct sbi_pmu_hw_event {
|
|||||||
/** Representation of a firmware event */
|
/** Representation of a firmware event */
|
||||||
struct sbi_pmu_fw_event {
|
struct sbi_pmu_fw_event {
|
||||||
/* Current value of the counter */
|
/* Current value of the counter */
|
||||||
unsigned long curr_count;
|
uint64_t curr_count;
|
||||||
|
|
||||||
/* A flag indicating pmu event monitoring is started */
|
/* A flag indicating pmu event monitoring is started */
|
||||||
bool bStarted;
|
bool bStarted;
|
||||||
@@ -719,8 +719,8 @@ int sbi_pmu_ctr_get_info(uint32_t cidx, unsigned long *ctr_info)
|
|||||||
} else {
|
} else {
|
||||||
/* it's a firmware counter */
|
/* it's a firmware counter */
|
||||||
cinfo.type = SBI_PMU_CTR_TYPE_FW;
|
cinfo.type = SBI_PMU_CTR_TYPE_FW;
|
||||||
/* Firmware counters are XLEN bits wide */
|
/* Firmware counters are always 64 bits wide */
|
||||||
cinfo.width = BITS_PER_LONG - 1;
|
cinfo.width = 63;
|
||||||
}
|
}
|
||||||
|
|
||||||
*ctr_info = cinfo.value;
|
*ctr_info = cinfo.value;
|
||||||
|
Reference in New Issue
Block a user