aboutsummaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2023-12-07 14:23:49 -0800
committerAnup Patel <anup@brainfault.org>2023-12-08 22:50:21 +0530
commitee725174bada254f8a081937d870feb837618d6e (patch)
tree12030a822aaa6cec70ed38aabd019cd860ce9eb7 /include/sbi
parent93da66b7d40605c3288ba05e70de8ef1914cdb60 (diff)
downloadopensbi-ee725174bada254f8a081937d870feb837618d6e.zip
opensbi-ee725174bada254f8a081937d870feb837618d6e.tar.gz
opensbi-ee725174bada254f8a081937d870feb837618d6e.tar.bz2
lib: sbi_pmu: Add PMU snapshot definitions
OpenSBI doesn't support SBI PMU snapshot yet as there is not much benefit unless the multiple counters overflow at the same time. Just add the definition and return not supported error at this moment. The default returned error is also not supported. Thus, no functional change intended. Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/sbi_ecall_interface.h6
-rw-r--r--include/sbi/sbi_error.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h
index 1fe469e..d8c646d 100644
--- a/include/sbi/sbi_ecall_interface.h
+++ b/include/sbi/sbi_ecall_interface.h
@@ -103,6 +103,7 @@
#define SBI_EXT_PMU_COUNTER_STOP 0x4
#define SBI_EXT_PMU_COUNTER_FW_READ 0x5
#define SBI_EXT_PMU_COUNTER_FW_READ_HI 0x6
+#define SBI_EXT_PMU_SNAPSHOT_SET_SHMEM 0x7
/** General pmu event codes specified in SBI PMU extension */
enum sbi_pmu_hw_generic_events_t {
@@ -241,9 +242,11 @@ enum sbi_pmu_ctr_type {
/* Flags defined for counter start function */
#define SBI_PMU_START_FLAG_SET_INIT_VALUE (1 << 0)
+#define SBI_PMU_START_FLAG_INIT_FROM_SNAPSHOT (1 << 1)
/* Flags defined for counter stop function */
#define SBI_PMU_STOP_FLAG_RESET (1 << 0)
+#define SBI_PMU_STOP_FLAG_TAKE_SNAPSHOT (1 << 1)
/* SBI function IDs for DBCN extension */
#define SBI_EXT_DBCN_CONSOLE_WRITE 0x0
@@ -309,8 +312,9 @@ enum sbi_cppc_reg_id {
#define SBI_ERR_ALREADY_AVAILABLE -6
#define SBI_ERR_ALREADY_STARTED -7
#define SBI_ERR_ALREADY_STOPPED -8
+#define SBI_ERR_NO_SHMEM -9
-#define SBI_LAST_ERR SBI_ERR_ALREADY_STOPPED
+#define SBI_LAST_ERR SBI_ERR_NO_SHMEM
/* clang-format on */
diff --git a/include/sbi/sbi_error.h b/include/sbi/sbi_error.h
index dd65e14..7f97506 100644
--- a/include/sbi/sbi_error.h
+++ b/include/sbi/sbi_error.h
@@ -23,6 +23,7 @@
#define SBI_EALREADY SBI_ERR_ALREADY_AVAILABLE
#define SBI_EALREADY_STARTED SBI_ERR_ALREADY_STARTED
#define SBI_EALREADY_STOPPED SBI_ERR_ALREADY_STOPPED
+#define SBI_ENO_SHMEM SBI_ERR_NO_SHMEM
#define SBI_ENODEV -1000
#define SBI_ENOSYS -1001