]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - hypervisor/arch/arm/irqchip.c
arm: Remove SPI target reset on cell destruction
[jailhouse.git] / hypervisor / arch / arm / irqchip.c
index 7dbd6691feabe797aa31362236517e6fb8f42b7d..47673dd34f125845c7d458c5c3a8c2976f69edf6 100644 (file)
@@ -43,12 +43,12 @@ unsigned long gicd_size;
  */
 static bool irqchip_is_init;
 
-bool spi_in_cell(struct cell *cell, unsigned int spi)
+bool irqchip_irq_in_cell(struct cell *cell, unsigned int irq_id)
 {
-       if (spi + 32 >= sizeof(cell->arch.irq_bitmap) * 8)
+       if (irq_id >= sizeof(cell->arch.irq_bitmap) * 8)
                return false;
 
-       return cell->arch.irq_bitmap[(spi + 32) / 32] & (1 << (spi % 32));
+       return (cell->arch.irq_bitmap[irq_id / 32] & (1 << (irq_id % 32))) != 0;
 }
 
 void irqchip_set_pending(struct per_cpu *cpu_data, u16 irq_id)
@@ -202,7 +202,8 @@ void irqchip_cell_exit(struct cell *cell)
                                chip->pin_bitmap[pos];
        }
 
-       irqchip.cell_exit(cell);
+       if (irqchip.cell_exit)
+               irqchip.cell_exit(cell);
 }
 
 void irqchip_root_cell_shrink(struct cell *cell)