summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <[email protected]>2022-08-24 11:44:40 +0530
committerAnup Patel <[email protected]>2022-09-01 16:53:18 +0530
commite238459fabb7bdf9237662297bbe8b177e0fb906 (patch)
treebb2b8f52fc2e6691e4add2acc0a2417681226af4 /lib
parent1664d0efce0b7945394148870acafe19c2b3e900 (diff)
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 <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi/sbi_pmu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sbi/sbi_pmu.c b/lib/sbi/sbi_pmu.c
index 250808ec..1c01d340 100644
--- a/lib/sbi/sbi_pmu.c
+++ b/lib/sbi/sbi_pmu.c
@@ -36,7 +36,7 @@ struct sbi_pmu_hw_event {
/** Representation of a firmware event */
struct sbi_pmu_fw_event {
/* Current value of the counter */
- unsigned long curr_count;
+ uint64_t curr_count;
/* A flag indicating pmu event monitoring is started */
bool bStarted;
@@ -719,8 +719,8 @@ int sbi_pmu_ctr_get_info(uint32_t cidx, unsigned long *ctr_info)
} else {
/* it's a firmware counter */
cinfo.type = SBI_PMU_CTR_TYPE_FW;
- /* Firmware counters are XLEN bits wide */
- cinfo.width = BITS_PER_LONG - 1;
+ /* Firmware counters are always 64 bits wide */
+ cinfo.width = 63;
}
*ctr_info = cinfo.value;