]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - hypervisor/arch/arm/irqchip.c
arm: Consolidate gic_irqchip to irqchip
[jailhouse.git] / hypervisor / arch / arm / irqchip.c
index a1772200e3d093c263c140b07a7a36af0f75ab5a..0b1193ccc7be57eeff0959e61b683707367939f1 100644 (file)
@@ -24,6 +24,8 @@
 /* AMBA's biosfood */
 #define AMBA_DEVICE    0xb105f00d
 
+extern struct irqchip_ops irqchip;
+
 void *gicd_base;
 unsigned long gicd_size;
 
@@ -32,7 +34,6 @@ unsigned long gicd_size;
  * per-cpu setup, which means that a bool must be set by the master CPU
  */
 static bool irqchip_is_init;
-static struct irqchip_ops irqchip;
 
 bool spi_in_cell(struct cell *cell, unsigned int spi)
 {
@@ -189,9 +190,6 @@ void irqchip_root_cell_shrink(struct cell *cell)
        root_cell.arch.spis &= ~(cell->arch.spis);
 }
 
-/* Only the GIC is implemented */
-extern struct irqchip_ops gic_irqchip;
-
 int irqchip_init(void)
 {
        int i, err;
@@ -222,8 +220,9 @@ int irqchip_init(void)
        case 0x2:
        case 0x3:
        case 0x4:
-               memcpy(&irqchip, &gic_irqchip, sizeof(struct irqchip_ops));
                break;
+       default:
+               goto err_no_distributor;
        }
 
        if (irqchip.init) {
@@ -234,7 +233,7 @@ int irqchip_init(void)
        }
 
 err_no_distributor:
-       printk("GIC: no distributor found\n");
+       printk("GIC: no supported distributor found\n");
        arch_unmap_device(gicd_base, gicd_size);
 
        return -ENODEV;