aboutsummaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_hart.c
diff options
context:
space:
mode:
authorHeiko Stuebner <heiko@sntech.de>2022-10-04 18:42:23 +0200
committerAnup Patel <anup@brainfault.org>2022-10-13 09:52:01 +0530
commite54cb3298bfcaa2ac56fe51d0f39c901d5397166 (patch)
tree2ca3a04a00a34c7cf39d073de068657117d70b20 /lib/sbi/sbi_hart.c
parent3f3d401d2dfbed232d77012ba9289b62e98ad519 (diff)
downloadopensbi-e54cb3298bfcaa2ac56fe51d0f39c901d5397166.zip
opensbi-e54cb3298bfcaa2ac56fe51d0f39c901d5397166.tar.gz
opensbi-e54cb3298bfcaa2ac56fe51d0f39c901d5397166.tar.bz2
lib: sbi_pmu: move pmu irq information into pmu itself
Don't spread checking for pmu extensions through the code but instead introduce a sbi-pmu function that other code can call to get the correct information about the existence of the pmu interrupt. Add a sbi_pmu_device override function to allow overridung this bit as well if needed. Reviewed-by: Atish Patra <atishp@rivosinc.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Guo Ren <guoren@kernel.org> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Diffstat (limited to 'lib/sbi/sbi_hart.c')
-rw-r--r--lib/sbi/sbi_hart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 1294868..447f99e 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -19,6 +19,7 @@
#include <sbi/sbi_hart.h>
#include <sbi/sbi_math.h>
#include <sbi/sbi_platform.h>
+#include <sbi/sbi_pmu.h>
#include <sbi/sbi_string.h>
#include <sbi/sbi_trap.h>
@@ -208,8 +209,7 @@ 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_extension(scratch, SBI_HART_EXT_SSCOFPMF))
- interrupts |= MIP_LCOFIP;
+ interrupts |= sbi_pmu_irq_bit();
exceptions = (1U << CAUSE_MISALIGNED_FETCH) | (1U << CAUSE_BREAKPOINT) |
(1U << CAUSE_USER_ECALL);