Skip to content

Commit a13b040

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3-its: Move LPI definitions around
The various LPI definitions are in the middle of the code, and would be better placed at the beginning, given that we're going to use some of them much earlier. Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent 0edc23e commit a13b040

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@
4848

4949
#define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
5050

51+
static u32 lpi_id_bits;
52+
53+
/*
54+
* We allocate memory for PROPBASE to cover 2 ^ lpi_id_bits LPIs to
55+
* deal with (one configuration byte per interrupt). PENDBASE has to
56+
* be 64kB aligned (one bit per LPI, plus 8192 bits for SPI/PPI/SGI).
57+
*/
58+
#define LPI_NRBITS lpi_id_bits
59+
#define LPI_PROPBASE_SZ ALIGN(BIT(LPI_NRBITS), SZ_64K)
60+
#define LPI_PENDBASE_SZ ALIGN(BIT(LPI_NRBITS) / 8, SZ_64K)
61+
62+
#define LPI_PROP_DEFAULT_PRIO 0xa0
63+
5164
/*
5265
* Collection structure - just an ID, and a redistributor address to
5366
* ping. We use one per CPU as a bag of interrupts assigned to this
@@ -701,7 +714,6 @@ static struct irq_chip its_irq_chip = {
701714

702715
static unsigned long *lpi_bitmap;
703716
static u32 lpi_chunks;
704-
static u32 lpi_id_bits;
705717
static DEFINE_SPINLOCK(lpi_lock);
706718

707719
static int its_lpi_to_chunk(int lpi)
@@ -796,17 +808,6 @@ static void its_lpi_free(struct event_lpi_map *map)
796808
kfree(map->col_map);
797809
}
798810

799-
/*
800-
* We allocate memory for PROPBASE to cover 2 ^ lpi_id_bits LPIs to
801-
* deal with (one configuration byte per interrupt). PENDBASE has to
802-
* be 64kB aligned (one bit per LPI, plus 8192 bits for SPI/PPI/SGI).
803-
*/
804-
#define LPI_NRBITS lpi_id_bits
805-
#define LPI_PROPBASE_SZ ALIGN(BIT(LPI_NRBITS), SZ_64K)
806-
#define LPI_PENDBASE_SZ ALIGN(BIT(LPI_NRBITS) / 8, SZ_64K)
807-
808-
#define LPI_PROP_DEFAULT_PRIO 0xa0
809-
810811
static int __init its_alloc_lpi_tables(void)
811812
{
812813
phys_addr_t paddr;

0 commit comments

Comments
 (0)