mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-10-24 04:32:05 +01:00
lib: sbi: Implement firmware counters
RISC-V SBI v0.3 specification defines a set of firmware events that can provide additional information about the current firmware context. All of the firmware event monitoring are enabled now. The firmware events must be defined as raw perf event with MSB set as specified in the specification. Reviewed-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
1 parent
37f9b0f2f2
commit
764a17d852
6 files changed
+60
No files matched your search
@@ -12,6 +12,7 @@
|
||||
#include <sbi/sbi_error.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <sbi/sbi_pmu.h>
|
||||
#include <sbi/sbi_scratch.h>
|
||||
#include <sbi/sbi_timer.h>
|
||||
|
||||
@@ -88,6 +89,7 @@ void sbi_timer_set_delta_upper(ulong delta_upper)
|
||||
|
||||
void sbi_timer_event_start(u64 next_event)
|
||||
{
|
||||
sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SET_TIMER);
|
||||
if (timer_dev && timer_dev->timer_event_start)
|
||||
timer_dev->timer_event_start(next_event);
|
||||
csr_clear(CSR_MIP, MIP_STIP);
|
||||
|
||||
Reference in new issue
Block a user