[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3 2/2] xen/dt: Allow only IRQ translation that are mapped to main GIC



Xen is only able to handle one GIC controller. Some platform may contain
other interrupt controller.

Make sure to only translate IRQ mapped into the GIC handled by Xen.

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>

---
    Changes in v3:
        - Add an ASSERT to check that dt_interrupt_controller is not
        NULL.

    Changes in v2:
        - Fix compilation...
---
 xen/common/device_tree.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 310635e..cc45bd1 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1442,9 +1442,12 @@ int dt_irq_translate(const struct dt_raw_irq *raw,
                      struct dt_irq *out_irq)
 {
     ASSERT(dt_irq_xlate != NULL);
+    ASSERT(dt_interrupt_controller != NULL);
 
-    /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
+    if ( raw->controller != dt_interrupt_controller )
+        return -EINVAL;
 
+    /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
     return dt_irq_xlate(raw->specifier, raw->size,
                         &out_irq->irq, &out_irq->type);
 }
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.