diff options
author | Heiko Stuebner <heiko@sntech.de> | 2022-10-04 19:42:23 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-10-13 07:22:01 +0300 |
commit | e54cb3298bfcaa2ac56fe51d0f39c901d5397166 (patch) | |
tree | 2ca3a04a00a34c7cf39d073de068657117d70b20 /include | |
parent | 3f3d401d2dfbed232d77012ba9289b62e98ad519 (diff) | |
download | opensbi-e54cb3298bfcaa2ac56fe51d0f39c901d5397166.tar.xz |
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 'include')
-rw-r--r-- | include/sbi/sbi_pmu.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/sbi/sbi_pmu.h b/include/sbi/sbi_pmu.h index a2ce42d..c365243 100644 --- a/include/sbi/sbi_pmu.h +++ b/include/sbi/sbi_pmu.h @@ -73,6 +73,11 @@ struct sbi_pmu_device { * Note: 0 <= counter_index < SBI_PMU_HW_CTR_MAX */ void (*hw_counter_disable_irq)(uint32_t counter_index); + + /** + * Custom function returning the machine-specific irq-bit. + */ + int (*hw_counter_irq_bit)(void); }; /** Get the PMU platform device */ @@ -87,6 +92,9 @@ int sbi_pmu_init(struct sbi_scratch *scratch, bool cold_boot); /** Reset PMU during hart exit */ void sbi_pmu_exit(struct sbi_scratch *scratch); +/** Return the pmu irq bit depending on extension existence */ +int sbi_pmu_irq_bit(void); + /** * Add the hardware event to counter mapping information. This should be called * from the platform code to update the mapping table. |