Skip to content

Commit bfa80ee

Browse files
James MorseMarc Zyngier
authored andcommitted
irqchip/gic-v3: Add __gic_get_ppi_index() to find the PPI number from hwirq
gic_get_ppi_index() is a useful concept for ppi partitions, as the GIC has two PPI ranges but needs mapping to a single range when used as an index in the gic_data.ppi_descs[] array. Add a double-underscore version which takes just the intid. This will be used in the partition domain select and translate helpers to enable partition support for the EPPI range. Signed-off-by: James Morse <[email protected]> Reviewed-by: Valentin Schneider <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ff11764 commit bfa80ee

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,18 +446,23 @@ static void gic_irq_set_prio(struct irq_data *d, u8 prio)
446446
writeb_relaxed(prio, base + offset + index);
447447
}
448448

449-
static u32 gic_get_ppi_index(struct irq_data *d)
449+
static u32 __gic_get_ppi_index(irq_hw_number_t hwirq)
450450
{
451-
switch (get_intid_range(d)) {
451+
switch (__get_intid_range(hwirq)) {
452452
case PPI_RANGE:
453-
return d->hwirq - 16;
453+
return hwirq - 16;
454454
case EPPI_RANGE:
455-
return d->hwirq - EPPI_BASE_INTID + 16;
455+
return hwirq - EPPI_BASE_INTID + 16;
456456
default:
457457
unreachable();
458458
}
459459
}
460460

461+
static u32 gic_get_ppi_index(struct irq_data *d)
462+
{
463+
return __gic_get_ppi_index(d->hwirq);
464+
}
465+
461466
static int gic_irq_nmi_setup(struct irq_data *d)
462467
{
463468
struct irq_desc *desc = irq_to_desc(d->irq);

0 commit comments

Comments
 (0)