[PATCH 2/4] lib: utils: irqchip: aplic: Add aplic_get_list() accessor
David E. Garcia Porras
david.garcia at aheadcomputing.com
Fri Mar 27 22:43:45 PDT 2026
The internal aplic_list is static, preventing platform code from
iterating over registered APLIC devices for custom configuration
(e.g. enabling domain-level interrupts in MSI delivery mode).
Add aplic_get_list() to return a pointer to the list head, allowing
platform code to walk registered APLIC devices without breaking
encapsulation by extern-ing the static list directly.
Signed-off-by: David E. Garcia Porras <david.garcia at aheadcomputing.com>
---
include/sbi_utils/irqchip/aplic.h | 2 ++
lib/utils/irqchip/aplic.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/include/sbi_utils/irqchip/aplic.h b/include/sbi_utils/irqchip/aplic.h
index 286c8f94..e2cf5808 100644
--- a/include/sbi_utils/irqchip/aplic.h
+++ b/include/sbi_utils/irqchip/aplic.h
@@ -152,6 +152,8 @@ struct aplic_data {
int aplic_cold_irqchip_init(struct aplic_data *aplic);
+struct sbi_dlist *aplic_get_list(void);
+
void aplic_reinit_all(void);
#endif
diff --git a/lib/utils/irqchip/aplic.c b/lib/utils/irqchip/aplic.c
index a20cecf2..ad9abf86 100644
--- a/lib/utils/irqchip/aplic.c
+++ b/lib/utils/irqchip/aplic.c
@@ -90,6 +90,11 @@ static void aplic_init(struct aplic_data *aplic)
}
}
+struct sbi_dlist *aplic_get_list(void)
+{
+ return &aplic_list;
+}
+
void aplic_reinit_all(void)
{
struct aplic_data *aplic;
--
2.43.0
More information about the opensbi
mailing list