From patchwork Wed Jun 11 16:27:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 31789 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A3D4D203C2 for ; Wed, 11 Jun 2014 16:29:38 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf19272080oac.3 for ; Wed, 11 Jun 2014 09:29:38 -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=r2QigjtVc8UZSfB0KgXFILTPSa0YXLtC8PYOE4rtxGE=; b=DB3XoupVRDY3hM6J+vSQHOITgYZTvSWfXTXAUEHlRInTbOpB7V9VqxfJl9vGaCKCpM /UpqgsI+0g7eE/tFp14mftoNn59OZiRdTR2dWForlau4Gqqg9axpJwar3+pzW3zm43by yXB0IpxpdK3oyjgxv/DUThPjOrDzjfH1ev0UHyzV2ZtTdgoR+qY+0PUH6GuI2YpWE37R Cor11AUD5uUlSr6dwNs69pNby9gJfO4ZURJx6DxlUD8MQbYdhZ0IwP4qB9gemGAn9WK8 3T+evKsPFbbiHLEDpW1Sf55x6ASPTRPIEcPykJMt8aX0z9zyOD9ar619+WYt4hJm93G6 jOxw== X-Gm-Message-State: ALoCoQmpoilab2xO19fJIzy0Pe9FGBtggu95slboXu40JYTYHlgXQzbN3XU6icJHJb1T1f3i8TJc X-Received: by 10.182.43.196 with SMTP id y4mr705288obl.35.1402504178306; Wed, 11 Jun 2014 09:29:38 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.162 with SMTP id e31ls317899qgf.10.gmail; Wed, 11 Jun 2014 09:29:38 -0700 (PDT) X-Received: by 10.52.76.33 with SMTP id h1mr3157141vdw.45.1402504178121; Wed, 11 Jun 2014 09:29:38 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id zc15si14348901vdb.79.2014.06.11.09.29.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Jun 2014 09:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id us18so9332694veb.6 for ; Wed, 11 Jun 2014 09:29:38 -0700 (PDT) X-Received: by 10.58.122.138 with SMTP id ls10mr18957411veb.13.1402504178035; Wed, 11 Jun 2014 09:29:38 -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.221.54.6 with SMTP id vs6csp317039vcb; Wed, 11 Jun 2014 09:29:37 -0700 (PDT) X-Received: by 10.52.33.241 with SMTP id u17mr818002vdi.82.1402504177651; Wed, 11 Jun 2014 09:29:37 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id um1si14400951veb.11.2014.06.11.09.29.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 11 Jun 2014 09:29:37 -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 1WulNG-0007MH-IO; Wed, 11 Jun 2014 16:27:42 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WulNE-0007Lk-Nk for xen-devel@lists.xensource.com; Wed, 11 Jun 2014 16:27:40 +0000 Received: from [85.158.143.35:52445] by server-2.bemta-4.messagelabs.com id 90/76-06539-C7388935; Wed, 11 Jun 2014 16:27:40 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-13.tower-21.messagelabs.com!1402504058!3440404!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12067 invoked from network); 11 Jun 2014 16:27:39 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 11 Jun 2014 16:27:39 -0000 X-IronPort-AV: E=Sophos;i="5.01,459,1400025600"; d="scan'208";a="142549126" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 11 Jun 2014 16:27:38 +0000 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; Wed, 11 Jun 2014 12:27:37 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WulN5-0004U7-TX; Wed, 11 Jun 2014 17:27:31 +0100 From: Stefano Stabellini To: Date: Wed, 11 Jun 2014 17:27:08 +0100 Message-ID: <1402504032-13267-2-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@citrix.com, Ian.Campbell@citrix.com, Stefano Stabellini Subject: [Xen-devel] [PATCH v5 2/6] xen/arm: introduce vgic_rank_irq 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: stefano.stabellini@eu.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.128.175 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: Introduce vgic_rank_irq: a new helper function that gives you the struct vgic_irq_rank corresponding to a given irq number. Use it in vgic_vcpu_inject_irq. Signed-off-by: Stefano Stabellini Acked-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/vgic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index f8cb3d5..757707e 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -73,6 +73,11 @@ static struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n) return NULL; } +static struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq) +{ + return vgic_rank_offset(v, 8, irq >> 2); +} + int domain_vgic_init(struct domain *d) { int i; @@ -720,7 +725,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq) { int idx = irq >> 2, byte = irq & 0x3; uint8_t priority; - struct vgic_irq_rank *rank = vgic_rank_offset(v, 8, idx); + struct vgic_irq_rank *rank = vgic_rank_irq(v, irq); struct pending_irq *iter, *n = irq_to_pending(v, irq); unsigned long flags; bool_t running;