From 36cf4d2a9c363b2799289221cf0fe7bd030bc107 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 19 Jun 2018 16:14:23 +0000 Subject: [PATCH] Move common GIC interrupt numbers to the common header. These are the same across the GICv2 and GICv3 drivers so we only need a single copy of them. Sponsored by: Turing Robotic Industries --- sys/arm/arm/gic.h | 6 ------ sys/arm/arm/gic_common.h | 9 +++++++++ sys/arm64/arm64/gic_v3_reg.h | 9 +-------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/arm/arm/gic.h b/sys/arm/arm/gic.h index c1b7d532ca90..5352408c7f9c 100644 --- a/sys/arm/arm/gic.h +++ b/sys/arm/arm/gic.h @@ -39,12 +39,6 @@ #ifndef _ARM_GIC_H_ #define _ARM_GIC_H_ -#define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */ -#define GIC_LAST_SGI 15 -#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */ -#define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ -#define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ - #ifdef INTRNG struct arm_gic_range { uint64_t bus; diff --git a/sys/arm/arm/gic_common.h b/sys/arm/arm/gic_common.h index 5cc8f5650b5e..6643496afc38 100644 --- a/sys/arm/arm/gic_common.h +++ b/sys/arm/arm/gic_common.h @@ -44,6 +44,15 @@ __BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int); __BUS_ACCESSOR(gic, bus, GIC, BUS, u_int); +/* Software Generated Interrupts */ +#define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */ +#define GIC_LAST_SGI 15 +/* Private Peripheral Interrupts */ +#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */ +#define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ +/* Shared Peripheral Interrupts */ +#define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ + /* Common register values */ #define GICD_CTLR 0x0000 /* v1 ICDDCR */ #define GICD_TYPER 0x0004 /* v1 ICDICTR */ diff --git a/sys/arm64/arm64/gic_v3_reg.h b/sys/arm64/arm64/gic_v3_reg.h index f3ab2ee54a03..538bec721a58 100644 --- a/sys/arm64/arm64/gic_v3_reg.h +++ b/sys/arm64/arm64/gic_v3_reg.h @@ -44,14 +44,7 @@ /* Upper value is determined by LPI max priority */ #define GIC_PRIORITY_MIN (0xFCUL) -/* Numbers for software generated interrupts */ -#define GIC_FIRST_SGI (0) -#define GIC_LAST_SGI (15) -/* Numbers for private peripheral interrupts */ -#define GIC_FIRST_PPI (16) -#define GIC_LAST_PPI (31) -/* Numbers for spared peripheral interrupts */ -#define GIC_FIRST_SPI (32) +/* Numbers for shared peripheral interrupts */ #define GIC_LAST_SPI (1019) /* Numbers for local peripheral interrupts */ #define GIC_FIRST_LPI (8192)