xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>,
	stefano.stabellini@eu.citrix.com, julien.grall@linaro.org,
	tim@xen.org, Clark Laughlin <clark.laughlin@linaro.org>,
	Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Subject: [PATCH 3/5] xen: arm: Add DT_NR_GIC_INTERRUPT_CELLS rather than hardcoding 3
Date: Fri, 24 Oct 2014 10:58:35 +0100	[thread overview]
Message-ID: <1414144717-32328-3-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1414144694.15687.31.camel@citrix.com>

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(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index de180d8..998b6fd 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -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)
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 70d10d6..148f555 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -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 */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 187dc46..d697dd9 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -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)
-- 
1.7.10.4

  parent reply	other threads:[~2014-10-24  9:58 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24  9:58 [PATCH for-4.6 0/5] xen: arm: Parse PCI DT nodes' ranges and interrupt-map Ian Campbell
2014-10-24  9:58 ` [PATCH 1/5] xen: arm: propagate gic's #address-cells property to dom0 Ian Campbell
2014-10-29 19:03   ` Julien Grall
2014-10-30 10:06     ` Ian Campbell
2014-10-30 10:31       ` Julien Grall
2014-11-04 10:23     ` Ian Campbell
2014-11-04 17:11       ` Konrad Rzeszutek Wilk
2014-11-05 10:47         ` Ian Campbell
2014-10-24  9:58 ` [PATCH 2/5] xen: device-tree: add accessors for the addr/size-cells of a node's children Ian Campbell
2014-10-24  9:58 ` Ian Campbell [this message]
2014-10-24  9:58 ` [PATCH 4/5] xen: refactor irq_set_type out of platform_get_irq Ian Campbell
2014-10-24  9:58 ` [PATCH 5/5] xen: arm: handle PCI DT node ranges and interrupt-map properties Ian Campbell
2015-02-17 17:33   ` Julien Grall
2015-02-18 13:50     ` Ian Campbell
2015-02-18 14:19       ` Julien Grall
2015-02-18 14:37         ` Ian Campbell
2015-02-18 15:05           ` Julien Grall
2015-02-18 15:16             ` Julien Grall
2015-03-05 12:43               ` Ian Campbell
2015-03-05 15:59                 ` Julien Grall
2015-02-18 15:18             ` Ian Campbell
2015-02-18 15:31               ` Julien Grall
2015-02-18 15:44                 ` Ian Campbell
2015-02-18 15:13           ` Julien Grall
2015-02-18 15:21             ` Ian Campbell
2015-02-16  3:49 ` [PATCH for-4.6 0/5] xen: arm: Parse PCI DT nodes' ranges and interrupt-map Suravee Suthikulpanit
2015-02-16 10:12   ` Julien Grall
     [not found]     ` <54E2AFCC.3090302@amd.com>
2015-02-17 13:43       ` Julien Grall
2015-02-17 13:50         ` Andrew Cooper
2015-02-17 22:35           ` Suravee Suthikulanit
2015-02-18  0:31             ` Suravee Suthikulanit
2015-02-18  5:28               ` Suravee Suthikulanit
2015-02-18 12:48                 ` Julien Grall
2015-02-18 20:13                   ` Suravee Suthikulanit
2015-02-19  5:16                     ` Manish
2015-02-19  8:14                     ` Jan Beulich
2015-02-19  8:47                       ` Manish
2015-02-19 13:46                     ` Julien Grall
2015-02-18  7:58               ` Jan Beulich
2015-02-18 13:52   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414144717-32328-3-git-send-email-ian.campbell@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=clark.laughlin@linaro.org \
    --cc=julien.grall@linaro.org \
    --cc=pranavkumar@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).