summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Holland <[email protected]>2024-11-04 20:10:07 -0800
committerAnup Patel <[email protected]>2024-11-28 11:37:25 +0530
commite3e5686ef903d037c6b5835a6752481a07faf99f (patch)
treec254982b0cd822c710a27e51c3b6a5f9e1a2ad1d /include
parent56fddce83f163e5e90ea82bf78a8df3d990b0572 (diff)
lib: sbi_irqchip: Register devices during cold init
Have the SBI irqchip core keep track of registered irqchip devices. This is useful for any callbacks the irqchip driver may have, such as for warm initialization, the external interrupt handler function, and any future support for handling external interrupts (beyond IPIs) in M-mode. This improves on the tracking done in fdt_irqchip.c, as it tracks device instances, not just drivers, so callbacks can target a specific device. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/sbi_irqchip.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/sbi/sbi_irqchip.h b/include/sbi/sbi_irqchip.h
index 0ed02eb4..c88b760a 100644
--- a/include/sbi/sbi_irqchip.h
+++ b/include/sbi/sbi_irqchip.h
@@ -10,10 +10,17 @@
#ifndef __SBI_IRQCHIP_H__
#define __SBI_IRQCHIP_H__
+#include <sbi/sbi_list.h>
#include <sbi/sbi_types.h>
struct sbi_scratch;
+/** irqchip hardware device */
+struct sbi_irqchip_device {
+ /** Node in the list of irqchip devices */
+ struct sbi_dlist node;
+};
+
/**
* Set external interrupt handling function
*
@@ -34,6 +41,9 @@ void sbi_irqchip_set_irqfn(int (*fn)(void));
*/
int sbi_irqchip_process(void);
+/** Register an irqchip device to receive callbacks */
+void sbi_irqchip_add_device(struct sbi_irqchip_device *dev);
+
/** Initialize interrupt controllers */
int sbi_irqchip_init(struct sbi_scratch *scratch, bool cold_boot);