xen/arm: Gate GICv3 change with HAS_GICV3 rather than CONFIG_ARM_64...
authorJulien Grall <julien.grall@citrix.com>
Wed, 1 Jul 2015 11:01:00 +0000 (12:01 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 3 Jul 2015 09:06:40 +0000 (10:06 +0100)
for clarity and it will be easier to understand some follow-up patches.

Also gate gic_v3 structure with HAS_GICV3.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
config/arm64.mk
xen/arch/arm/Makefile
xen/arch/arm/Rules.mk
xen/arch/arm/vgic.c
xen/include/asm-arm/domain.h
xen/include/asm-arm/gic.h

index e24c1d1b85faf4625d931b9848d24bbb77d1340e..c5deb4e4b43cbfe28da0c7a9053e2c65e31e6eab 100644 (file)
@@ -10,6 +10,7 @@ HAS_PL011 := y
 HAS_CADENCE_UART := y
 HAS_NS16550 := y
 HAS_MEM_ACCESS := y
+HAS_GICV3 := y
 
 # Use only if calling $(LD) directly.
 LDFLAGS_DIRECT += -EL
index 935999e104945e595e4841126210226b53f36e95..1ef39f7cdd4ac002c79893a83c7b571e9612a06d 100644 (file)
@@ -13,7 +13,7 @@ obj-y += sysctl.o
 obj-y += domain_build.o
 obj-y += gic.o gic-v2.o
 obj-$(CONFIG_ARM_32) += gic-hip04.o
-obj-$(CONFIG_ARM_64) += gic-v3.o
+obj-$(HAS_GICV3) += gic-v3.o
 obj-y += io.o
 obj-y += irq.o
 obj-y += kernel.o
index e27f573668268d34412b7c218fef64a4d798c16b..b31770c69556f9f331b6217f8fa531d9fecdd961 100644 (file)
@@ -38,6 +38,8 @@ ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
 CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE
 endif
 
+CFLAGS-$(HAS_GICV3) += -DHAS_GICV3
+
 EARLY_PRINTK := n
 
 ifeq ($(debug),y)
index 73a6f7eddd0d16e7bd72ab9962270ecf91ebed64..dfd959aef1d64fefd2cb369ff4ddfa51be9569f1 100644 (file)
@@ -82,7 +82,7 @@ int domain_vgic_init(struct domain *d, unsigned int nr_spis)
 
     switch ( gic_hw_version() )
     {
-#ifdef CONFIG_ARM_64
+#ifdef HAS_GICV3
     case GIC_V3:
         if ( vgic_v3_init(d) )
            return -ENODEV;
index f1a087ed05e25dafd40a5191913ffac9a22363af..96607d59de05c3a28a926476e86981d16b49cc7c 100644 (file)
@@ -101,7 +101,7 @@ struct arch_domain
         /* Base address for guest GIC */
         paddr_t dbase; /* Distributor base address */
         paddr_t cbase; /* CPU base address */
-#ifdef CONFIG_ARM_64
+#ifdef HAS_GICV3
         /* GIC V3 addressing */
         paddr_t dbase_size; /* Distributor base size */
         /* List of contiguous occupied by the redistributors */
index 9e2acb7309f30afccc9ce4123cb940005b79d809..f0dcfa1d7a4f0a64d82ac9a5384fdebe70da823a 100644 (file)
 
 #define DT_MATCH_GIC_V3 DT_MATCH_COMPATIBLE("arm,gic-v3")
 
+#ifdef HAS_GICV3
 /*
  * GICv3 registers that needs to be saved/restored
  */
@@ -171,6 +172,7 @@ struct gic_v3 {
     uint32_t apr1[4];
     uint64_t lr[16];
 };
+#endif
 
 /*
  * GICv2 register that needs to be saved/restored
@@ -188,7 +190,9 @@ struct gic_v2 {
  */
 union gic_state_data {
     struct gic_v2 v2;
+#ifdef HAS_GICV3
     struct gic_v3 v3;
+#endif
 };
 
 /*