aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@oss.qualcomm.com>2026-02-13 11:23:39 +0530
committerAnup Patel <anup@brainfault.org>2026-03-22 10:53:33 +0530
commitb55bb4cdcb298c12a316713d6cc7948973c14f9b (patch)
treec6ff86c0798e3ed42ba15c0e5f033ca529b3853b /include
parent5a300b32d546d226e55361e47d07b1c9171f07c8 (diff)
downloadopensbi-b55bb4cdcb298c12a316713d6cc7948973c14f9b.tar.gz
opensbi-b55bb4cdcb298c12a316713d6cc7948973c14f9b.tar.bz2
opensbi-b55bb4cdcb298c12a316713d6cc7948973c14f9b.zip
lib: sbi_irqchip: Support irqchip device targetting subset of harts
It is possible to have platform where an irqchip device targets a subset of harts and there are multiple irqchip devices to cover all harts. To support this scenario: 1) Add target_harts hartmask to struct sbi_irqchip_device which represents the set of harts targetted by the irqchip device 2) Call warm_init() and process_hwirqs() callbacks of an irqchip device on a hart only if irqchip device targets that particular hart Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260213055342.3124872-6-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_irqchip.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/sbi/sbi_irqchip.h b/include/sbi/sbi_irqchip.h
index cda1e50f..c3ded271 100644
--- a/include/sbi/sbi_irqchip.h
+++ b/include/sbi/sbi_irqchip.h
@@ -10,6 +10,7 @@
#ifndef __SBI_IRQCHIP_H__
#define __SBI_IRQCHIP_H__
+#include <sbi/sbi_hartmask.h>
#include <sbi/sbi_list.h>
#include <sbi/sbi_types.h>
@@ -20,11 +21,14 @@ struct sbi_irqchip_device {
/** Node in the list of irqchip devices */
struct sbi_dlist node;
+ /** Set of harts targetted by this irqchip */
+ struct sbi_hartmask target_harts;
+
/** Initialize per-hart state for the current hart */
int (*warm_init)(struct sbi_irqchip_device *chip);
/** Process hardware interrupts from this irqchip */
- int (*process_hwirqs)(void);
+ int (*process_hwirqs)(struct sbi_irqchip_device *chip);
};
/**
@@ -38,7 +42,7 @@ struct sbi_irqchip_device {
int sbi_irqchip_process(void);
/** Register an irqchip device to receive callbacks */
-void sbi_irqchip_add_device(struct sbi_irqchip_device *chip);
+int sbi_irqchip_add_device(struct sbi_irqchip_device *chip);
/** Initialize interrupt controllers */
int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot);