GIC generally uses a 4k memory region for the various subregions, such
as GICC, GICD, GICV and GICH. Macroify this number in the publicly
visible header.

Some machine model code may need to know the individual subregion size
to implement special addresses mappings (such as aliases and
under-decoding logic).

Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com>
---
 hw/intc/arm_gic.c         | 2 +-
 include/hw/intc/arm_gic.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index a04c822..694b424 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -791,7 +791,7 @@ void gic_init_irqs_and_distributor(GICState *s)
         sysbus_init_irq(sbd, &s->parent_irq[i]);
     }
     memory_region_init_io(&s->iomem, OBJECT(s), &gic_dist_ops, s,
-                          "gic_dist", 0x1000);
+                          "gic_dist", ARM_GIC_REGION_SIZE);
 }
 
 static void arm_gic_realize(DeviceState *dev, Error **errp)
diff --git a/include/hw/intc/arm_gic.h b/include/hw/intc/arm_gic.h
index 0971e37..659be27 100644
--- a/include/hw/intc/arm_gic.h
+++ b/include/hw/intc/arm_gic.h
@@ -31,6 +31,8 @@
 #define ARM_GIC_GET_CLASS(obj) \
      OBJECT_GET_CLASS(ARMGICClass, (obj), TYPE_ARM_GIC)
 
+#define ARM_GIC_REGION_SIZE   0x1000
+
 typedef struct ARMGICClass {
     /*< private >*/
     ARMGICCommonClass parent_class;
-- 
2.4.0.3.ge0ccc3b.dirty


Reply via email to