@@ -500,7 +500,7 @@ static int write_properties(struct domain *d, struct kernel_info *kinfo,
* This code is assuming the irq is an PPI.
*/
-typedef __be32 gic_interrupt_t[3];
+typedef __be32 gic_interrupt_t[DT_NR_GIC_INTERRUPT_CELLS];
static void set_interrupt_ppi(gic_interrupt_t interrupt, unsigned int irq,
unsigned int cpumask, unsigned int level)
@@ -147,7 +147,7 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
unsigned int *out_hwirq,
unsigned int *out_type)
{
- if ( intsize < 3 )
+ if ( intsize < DT_NR_GIC_INTERRUPT_CELLS )
return -EINVAL;
/* Get the interrupt number and add 16 to skip over SGIs */
@@ -22,6 +22,8 @@
#define NR_GIC_SGI 16
#define MAX_RDIST_COUNT 4
+#define DT_NR_GIC_INTERRUPT_CELLS 3
+
#define GICD_CTLR (0x000)
#define GICD_TYPER (0x004)
#define GICD_IIDR (0x008)
I'm going to need this elsewhere and would prefer to avoid writing 3 again. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> --- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/gic.c | 2 +- xen/include/asm-arm/gic.h | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)