From patchwork Thu Apr 3 20:41:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 27702 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-bk0-f70.google.com (mail-bk0-f70.google.com [209.85.214.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 523CE20490 for ; Thu, 3 Apr 2014 20:44:02 +0000 (UTC) Received: by mail-bk0-f70.google.com with SMTP id my13sf2616573bkb.9 for ; Thu, 03 Apr 2014 13:44:01 -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:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=c/Iq+1GroNAeJ7RdL25+3SSujidGfBONdH97o1wG9/k=; b=D1dsXwCZdTc7Idbrae4WkMNpFbTUxeWgj6CLdBybHlZIT1AmV0fQuqyzxEBD7KO8FD c1RqlA5ogHNybPnTIu2PWIDXEAmngaBCYESSCeS/SMkfo3YXIDtz4Rif7nq+fdsK4VYj 2+dwL3g/IQzoR4JyZ4GhgA+eYySrmXV6mwAxp83/MVtLQR0ou2OinA4fZGzPtgsfpUar nHjmobYMKTACDd3sRdTEv1c7E4xUtPG4gHrtf+EmoMqB4cb+lMD+4k9qoWj2GnhJ1tFP mz3bdkjBWVEf6THECz7kfGsyxJmj8AeTvSbhge7RFABg0kekGlU7Ifu1b2waugaaG092 quRw== X-Gm-Message-State: ALoCoQkt+tl29bsHyhNimvVP16YYLzAnRQ2HBNPF1vw3UXjVMajZc6m+P4sLqkPQUpjwCS27IwcN X-Received: by 10.14.225.6 with SMTP id y6mr2565840eep.2.1396557841166; Thu, 03 Apr 2014 13:44:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.136 with SMTP id v8ls773361qgd.13.gmail; Thu, 03 Apr 2014 13:44:01 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr4620680vcx.12.1396557840972; Thu, 03 Apr 2014 13:44:00 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id t16si1421809vcp.40.2014.04.03.13.44.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 13:44:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id lf12so2374387vcb.25 for ; Thu, 03 Apr 2014 13:44:00 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr2052086vcb.5.1396557840882; Thu, 03 Apr 2014 13:44:00 -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.220.12.8 with SMTP id v8csp59790vcv; Thu, 3 Apr 2014 13:43:59 -0700 (PDT) X-Received: by 10.52.163.145 with SMTP id yi17mr115871vdb.46.1396557839234; Thu, 03 Apr 2014 13:43:59 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id sw4si468425vdc.192.2014.04.03.13.43.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 13:43:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1WVoT7-0008Dy-10; Thu, 03 Apr 2014 20:42:37 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WVoT5-0008Cy-I8 for xen-devel@lists.xenproject.org; Thu, 03 Apr 2014 20:42:35 +0000 Received: from [193.109.254.147:35764] by server-6.bemta-14.messagelabs.com id F0/32-13066-AB7CD335; Thu, 03 Apr 2014 20:42:34 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-13.tower-27.messagelabs.com!1396557753!6137534!1 X-Originating-IP: [74.125.82.176] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4892 invoked from network); 3 Apr 2014 20:42:33 -0000 Received: from mail-we0-f176.google.com (HELO mail-we0-f176.google.com) (74.125.82.176) by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 3 Apr 2014 20:42:33 -0000 Received: by mail-we0-f176.google.com with SMTP id x48so2393390wes.7 for ; Thu, 03 Apr 2014 13:42:33 -0700 (PDT) X-Received: by 10.180.100.169 with SMTP id ez9mr41296287wib.15.1396557753392; Thu, 03 Apr 2014 13:42:33 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id t50sm14510572eev.28.2014.04.03.13.42.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Apr 2014 13:42:32 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 3 Apr 2014 21:41:59 +0100 Message-Id: <1396557727-19102-9-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396557727-19102-1-git-send-email-julien.grall@linaro.org> References: <1396557727-19102-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v2 08/16] xen/arm: IRQ Introduce irq_get_domain 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: , MIME-Version: 1.0 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: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: This function retrieves a domain from an IRQ. It will be used in several places (such as do_IRQ) to avoid duplicated code when multiple action will be supported. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v2: - Patch added --- xen/arch/arm/irq.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index f3a30bd..5111b90 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -98,6 +98,15 @@ void __cpuinit init_secondary_IRQ(void) BUG_ON(init_local_irq_data() < 0); } +static inline struct domain *irq_get_domain(struct irq_desc *desc) +{ + ASSERT(spin_is_locked(&desc->lock)); + ASSERT(desc->status & IRQ_GUEST); + ASSERT(desc->action != NULL); + + return desc->action->dev_id; +} + int request_dt_irq(const struct dt_irq *irq, void (*handler)(int, void *, struct cpu_user_regs *), const char *devname, void *dev_id) @@ -156,7 +165,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq) if ( desc->status & IRQ_GUEST ) { - struct domain *d = action->dev_id; + struct domain *d = irq_get_domain(desc); desc->handler->end(desc);