diff options
author | Atish Patra <atishp@rivosinc.com> | 2024-11-19 11:34:37 -0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-12-02 09:52:52 +0530 |
commit | 05970d273c609ff43b372f34150fba2855a94426 (patch) | |
tree | dfca1636ed2998f90a27893c768e7fc5b5d5db32 | |
parent | cf196d80aa0850cb9658a8e670fcbb72ed26dc71 (diff) | |
download | opensbi-05970d273c609ff43b372f34150fba2855a94426.zip opensbi-05970d273c609ff43b372f34150fba2855a94426.tar.gz opensbi-05970d273c609ff43b372f34150fba2855a94426.tar.bz2 |
lib: sbi_pmu: Add SBI PMU event info function details.
The SBI v3.0 introduced a new function to query about the events
without invoking CFG_MATCH. This allows supervisor software to
identify which events are supported on the platform with single
SBI call instead of a CFG_MATCH for each event.
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r-- | include/sbi/sbi_ecall_interface.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h index bcb7359..29b18f5 100644 --- a/include/sbi/sbi_ecall_interface.h +++ b/include/sbi/sbi_ecall_interface.h @@ -12,6 +12,8 @@ /* clang-format off */ +#include <sbi/sbi_types.h> + /* SBI Extension IDs */ #define SBI_EXT_0_1_SET_TIMER 0x0 #define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1 @@ -107,6 +109,7 @@ #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 +#define SBI_EXT_PMU_EVENT_GET_INFO 0x8 /* SBI function IDs for DBTR extension */ #define SBI_EXT_DBTR_NUM_TRIGGERS 0x0 @@ -256,6 +259,12 @@ enum sbi_pmu_ctr_type { SBI_PMU_CTR_TYPE_FW, }; +struct sbi_pmu_event_info { + uint32_t event_idx; + uint32_t output; + uint64_t event_data; +}; + /* Helper macros to decode event idx */ #define SBI_PMU_EVENT_IDX_MASK 0xFFFFF #define SBI_PMU_EVENT_IDX_TYPE_OFFSET 16 |