From patchwork Fri Oct 24 09:58:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 39415 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CBA4324044 for ; Fri, 24 Oct 2014 10:00:21 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id bs8sf465355wib.7 for ; Fri, 24 Oct 2014 03:00:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=SHH1GaG+1r4aKWq211BYDlr1jbLMKjla2T1HeWV5OvQ=; b=OpGcPzw03Cz+4q1Xo+rycJOvgpl3J8VCberMT207u5hgUtC45r3D/hcG4gBF5oAeqH DlSPfZ4SsAr6qdXuVjfQRsrhNGTZwVh6gBWI+yGrvE1ZVDK5q6vb3Ws22SinUtmlGel7 ML71b11TOxjV+f7a4fIv8WhB/3/tTXpXwllmBwb6MMbzDZ5+QYTcU75Bu1JzoEsUbiIm RjsEAU6H8eITG7JPdl95MYcdU5VJeyzujKrkU6Z+l0JrjBQ9NiUB+t6vKMdVS6levU7g dyUXkIkyCQyjACdv6lYh3xMRK387TWmoZ6+1BPM0dQwg/laxHhCdLC4aGb03pRlctRVm lcPA== X-Gm-Message-State: ALoCoQlRfPVQgbARRHBfm0gPBtrnPCTwYA4WABsOmHcXis6ieXnCmjxfQ+kf5N4zxAOId1MHtdXG X-Received: by 10.180.83.134 with SMTP id q6mr620397wiy.7.1414144821060; Fri, 24 Oct 2014 03:00:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.134 with SMTP id b6ls369780laa.77.gmail; Fri, 24 Oct 2014 03:00:20 -0700 (PDT) X-Received: by 10.112.52.33 with SMTP id q1mr3428997lbo.42.1414144820709; Fri, 24 Oct 2014 03:00:20 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id ao5si6198262lbc.58.2014.10.24.03.00.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 03:00:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id u10so2299641lbd.15 for ; Fri, 24 Oct 2014 03:00:20 -0700 (PDT) X-Received: by 10.112.221.197 with SMTP id qg5mr3323934lbc.32.1414144820494; Fri, 24 Oct 2014 03:00:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp398404lbz; Fri, 24 Oct 2014 03:00:19 -0700 (PDT) X-Received: by 10.224.163.78 with SMTP id z14mr4093926qax.69.1414144818610; Fri, 24 Oct 2014 03:00:18 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b66si6909194qga.118.2014.10.24.03.00.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 Oct 2014 03:00:18 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xhbdt-0001d5-FG; Fri, 24 Oct 2014 09:58:45 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xhbds-0001bP-6d for xen-devel@lists.xen.org; Fri, 24 Oct 2014 09:58:44 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id C4/AD-02953-3D22A445; Fri, 24 Oct 2014 09:58:43 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1414144720!11355236!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20423 invoked from network); 24 Oct 2014 09:58:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-8.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 24 Oct 2014 09:58:42 -0000 X-IronPort-AV: E=Sophos;i="5.04,779,1406592000"; d="scan'208";a="185837470" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Fri, 24 Oct 2014 05:58:40 -0400 Received: from drall.uk.xensource.com ([10.80.16.71]) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1Xhbdn-0003vL-QK; Fri, 24 Oct 2014 10:58:40 +0100 Received: by drall.uk.xensource.com (sSMTP sendmail emulation); Fri, 24 Oct 2014 10:58:39 +0100 From: Ian Campbell To: Date: Fri, 24 Oct 2014 10:58:35 +0100 Message-ID: <1414144717-32328-3-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1414144694.15687.31.camel@citrix.com> References: <1414144694.15687.31.camel@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Campbell , stefano.stabellini@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, Clark Laughlin , Pranavkumar Sawargaonkar Subject: [Xen-devel] [PATCH 3/5] xen: arm: Add DT_NR_GIC_INTERRUPT_CELLS rather than hardcoding 3 X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: I'm going to need this elsewhere and would prefer to avoid writing 3 again. Signed-off-by: Ian Campbell --- 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)