From: Julien Grall Date: Wed, 1 Jul 2015 11:01:00 +0000 (+0100) Subject: xen/arm: Gate GICv3 change with HAS_GICV3 rather than CONFIG_ARM_64... X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2969 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bbc317721c7ca3ab06502952f13de64aafebccec;p=xen.git xen/arm: Gate GICv3 change with HAS_GICV3 rather than CONFIG_ARM_64... 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 Acked-by: Ian Campbell --- diff --git a/config/arm64.mk b/config/arm64.mk index e24c1d1b85..c5deb4e4b4 100644 --- a/config/arm64.mk +++ b/config/arm64.mk @@ -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 diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 935999e104..1ef39f7cdd 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -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 diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index e27f573668..b31770c695 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -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) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 73a6f7eddd..dfd959aef1 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -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; diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index f1a087ed05..96607d59de 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -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 */ diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 9e2acb7309..f0dcfa1d7a 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -162,6 +162,7 @@ #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 }; /*