summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_ecall_pmu.c
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2022-08-24 09:09:02 +0300
committerAnup Patel <anup@brainfault.org>2022-09-01 14:23:16 +0300
commit1664d0efce0b7945394148870acafe19c2b3e900 (patch)
treea3d13e1b9b6c956b88d32c2e9cd28629976e3566 /lib/sbi/sbi_ecall_pmu.c
parenta90cf6b186bff1306a12abd290bd36f7a3702a24 (diff)
downloadopensbi-1664d0efce0b7945394148870acafe19c2b3e900.tar.xz
lib: sbi_pmu: Replace sbi_pmu_ctr_read() with sbi_pmu_ctr_fw_read()
The "read a firmware counter" SBI call should only work for firmware counters so let us replace sbi_pmu_ctr_read() with sbi_pmu_ctr_fw_read() which works only on firmware counters. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'lib/sbi/sbi_ecall_pmu.c')
-rw-r--r--lib/sbi/sbi_ecall_pmu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sbi/sbi_ecall_pmu.c b/lib/sbi/sbi_ecall_pmu.c
index 9ee9e81..826c8a8 100644
--- a/lib/sbi/sbi_ecall_pmu.c
+++ b/lib/sbi/sbi_ecall_pmu.c
@@ -51,7 +51,8 @@ static int sbi_ecall_pmu_handler(unsigned long extid, unsigned long funcid,
break;
case SBI_EXT_PMU_COUNTER_FW_READ:
- ret = sbi_pmu_ctr_read(regs->a0, out_val);
+ ret = sbi_pmu_ctr_fw_read(regs->a0, &temp);
+ *out_val = temp;
break;
case SBI_EXT_PMU_COUNTER_START: