summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAtish Patra <atish.patra@wdc.com>2021-11-08 21:52:59 +0300
committerAnup Patel <anup@brainfault.org>2021-11-11 15:15:12 +0300
commit9134c3643e420b1917cf98940552ef16467f7a34 (patch)
treea744935898916dd4b71c2c49fb0f7e0cc1508550 /lib
parent867c65360df283f056afa963ad8333e9c1eb21bb (diff)
downloadopensbi-9134c3643e420b1917cf98940552ef16467f7a34.tar.xz
lib: sbi: Delegate PMU counter overflow interrupt to S mode
OpenSBI doesn't handle PMU counters for now. Delegate the overflow counter to S-mode always. Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi/sbi_hart.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 7f31bb7..8a98d4d 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -115,6 +115,9 @@ static int delegate_traps(struct sbi_scratch *scratch)
/* Send M-mode interrupts and most exceptions to S-mode */
interrupts = MIP_SSIP | MIP_STIP | MIP_SEIP;
+ if (sbi_hart_has_feature(scratch, SBI_HART_HAS_SSCOFPMF))
+ interrupts |= MIP_LCOFIP;
+
exceptions = (1U << CAUSE_MISALIGNED_FETCH) | (1U << CAUSE_BREAKPOINT) |
(1U << CAUSE_USER_ECALL);
if (sbi_platform_has_mfaults_delegation(plat))