]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
arm: Fold irqchip_root_cell_shrink into irqchip_cell_init
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 26 Jun 2016 10:34:58 +0000 (12:34 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Mon, 27 Jun 2016 09:51:18 +0000 (11:51 +0200)
Simplifies the code.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/control.c
hypervisor/arch/arm/include/asm/irqchip.h
hypervisor/arch/arm/irqchip.c

index 918704ca512deb5179e0465e80b73bbe778899dd..b63b14b9d3f850097db4ece5f401f4eba49aa4d0 100644 (file)
@@ -359,7 +359,6 @@ int arch_cell_create(struct cell *cell)
                arch_mmu_cell_destroy(cell);
                return err;
        }
-       irqchip_root_cell_shrink(cell);
 
        register_smp_ops(cell);
 
index 56b1b4a1ce786f654ca87310a5c9af902407750b..eb78a582cb2cf396525222016d1bd53566392ca9 100644 (file)
@@ -64,7 +64,6 @@ void irqchip_cpu_shutdown(struct per_cpu *cpu_data);
 
 int irqchip_cell_init(struct cell *cell);
 void irqchip_cell_exit(struct cell *cell);
-void irqchip_root_cell_shrink(struct cell *cell);
 
 int irqchip_send_sgi(struct sgi *sgi);
 void irqchip_handle_irq(struct per_cpu *cpu_data);
index 47673dd34f125845c7d458c5c3a8c2976f69edf6..ef017913e96bfd066e080ead0fc5b12ced8e8a4b 100644 (file)
@@ -152,7 +152,8 @@ void irqchip_cpu_shutdown(struct per_cpu *cpu_data)
 int irqchip_cell_init(struct cell *cell)
 {
        const struct jailhouse_irqchip *chip;
-       unsigned int n;
+       unsigned int n, pos;
+       int err;
 
        for_each_irqchip(chip, cell->config, n) {
                if (chip->address != (unsigned long)gicd_base)
@@ -171,7 +172,20 @@ int irqchip_cell_init(struct cell *cell)
        cell->arch.irq_bitmap[0] = ~((1 << SGI_INJECT) | (1 << SGI_CPU_OFF) |
                                     (1 << MAINTENANCE_IRQ));
 
-       return irqchip.cell_init(cell);
+       err = irqchip.cell_init(cell);
+       if (err)
+               return err;
+
+       if (cell != &root_cell)
+               for_each_irqchip(chip, cell->config, n) {
+                       if (chip->address != (unsigned long)gicd_base)
+                               continue;
+                       for (pos = 0; pos < ARRAY_SIZE(chip->pin_bitmap); pos++)
+                               root_cell.arch.irq_bitmap[chip->pin_base/32] &=
+                                       ~chip->pin_bitmap[pos];
+               }
+
+       return 0;
 }
 
 void irqchip_cell_exit(struct cell *cell)
@@ -206,20 +220,6 @@ void irqchip_cell_exit(struct cell *cell)
                irqchip.cell_exit(cell);
 }
 
-void irqchip_root_cell_shrink(struct cell *cell)
-{
-       const struct jailhouse_irqchip *irqchip;
-       unsigned int n, pos;
-
-       for_each_irqchip(irqchip, cell->config, n) {
-               if (irqchip->address != (unsigned long)gicd_base)
-                       continue;
-               for (pos = 0; pos < ARRAY_SIZE(irqchip->pin_bitmap); pos++)
-                       root_cell.arch.irq_bitmap[irqchip->pin_base / 32] &=
-                               ~irqchip->pin_bitmap[pos];
-       }
-}
-
 int irqchip_init(void)
 {
        int i, err;