diff options
author | Andre Przywara <andre.przywara@arm.com> | 2016-04-09 00:30:34 +0100 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2016-06-02 01:28:54 +0100 |
commit | c243376d301924b5b3b03a1ba85de3119572d67f (patch) | |
tree | 4cdb8a26a4f25619161ce47921271a00a0ac3ae5 /drivers/arm | |
parent | ed866a553189e33cf3bce0913d8e5519566e2a29 (diff) |
drivers: arm_gic: allow zero secure interrupts
Currently the generic GIC driver code has an assert to halt if no valid
pointer to the list of secure interrupts is specified.
Rework this to barf only if the number of secure interrupts is greater
than zero.
This allows to specify zero secure interrupts and pass a NULL pointer
for the table address.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/arm')
-rw-r--r-- | drivers/arm/gic/arm_gic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/arm/gic/arm_gic.c b/drivers/arm/gic/arm_gic.c index 0600af8..71272f4 100644 --- a/drivers/arm/gic/arm_gic.c +++ b/drivers/arm/gic/arm_gic.c @@ -224,7 +224,7 @@ void arm_gic_pcpu_distif_setup(void) assert(g_gicd_base); gicd_write_igroupr(g_gicd_base, 0, ~0); - assert(g_irq_sec_ptr); + assert(!g_num_irqs || g_irq_sec_ptr); for (index = 0; index < g_num_irqs; index++) { irq_num = g_irq_sec_ptr[index]; if (irq_num < MIN_SPI_ID) { @@ -264,7 +264,7 @@ static void arm_gic_distif_setup(void) gicd_write_igroupr(g_gicd_base, index << IGROUPR_SHIFT, ~0); /* Configure secure interrupts now */ - assert(g_irq_sec_ptr); + assert(!g_num_irqs || g_irq_sec_ptr); for (index = 0; index < g_num_irqs; index++) { irq_num = g_irq_sec_ptr[index]; if (irq_num >= MIN_SPI_ID) { @@ -296,7 +296,7 @@ void arm_gic_init(unsigned int gicc_base, assert(gicc_base); assert(gicd_base); assert(gicr_base); - assert(irq_sec_ptr); + assert(!num_irqs || irq_sec_ptr); g_gicc_base = gicc_base; g_gicd_base = gicd_base; g_gicr_base = gicr_base; |