aboutsummaryrefslogtreecommitdiff
path: root/core/interrupts.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/interrupts.c')
-rw-r--r--core/interrupts.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/core/interrupts.c b/core/interrupts.c
index 35571f2..03a37b2 100644
--- a/core/interrupts.c
+++ b/core/interrupts.c
@@ -199,6 +199,21 @@ uint32_t get_ics_phandle(void)
abort();
}
+static bool source_has_opal_interrupts(struct irq_source *is)
+{
+ /* check with the source first */
+ if (is->ops->has_opal_interrupts)
+ return is->ops->has_opal_interrupts(is);
+ /*
+ * Default case: to handle an interrupt in opal, a source
+ * needs at least an attribute callback to declare it and a
+ * handler
+ */
+ if (!is->ops->interrupt || !is->ops->attributes)
+ return false;
+ return true;
+}
+
void add_opal_interrupts(void)
{
struct irq_source *is;
@@ -214,11 +229,8 @@ void add_opal_interrupts(void)
lock(&irq_lock);
list_for_each(&irq_sources, is, link) {
- /*
- * Don't even consider sources that don't have an interrupts
- * callback or don't have an attributes one.
- */
- if (!is->ops->interrupt || !is->ops->attributes)
+
+ if (!source_has_opal_interrupts(is))
continue;
for (isn = is->start; isn < is->end; isn++) {
uint64_t attr = is->ops->attributes(is, isn);