From patchwork Fri Apr 17 08:55:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PranavkumarSawargaonkar X-Patchwork-Id: 47259 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 C83A42121F for ; Fri, 17 Apr 2015 09:00:05 +0000 (UTC) Received: by widjs5 with SMTP id js5sf2672756wid.3 for ; Fri, 17 Apr 2015 02:00:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=1nrpqUd+MFszfp83n/5ucka5TSAfX1y1QhtRu/RnbEc=; b=KeZWmyZInBQeSF56vMXJE9DenB/sy/9dbjGFN5uWG/NwM9Ah2mitaZKIWwrG/tF1xl uceF1rwuk+bqr386t9GFB4VzLPDSlzSKZ7rvrjG4cjSFNSNuHToCVG2+pq+2SfIQgEwq DXVQdm18HQttbW5N2qtwwx031nz71cZUe6lgJFN7qFtwpagoUXoMk4fPfpZtctxxFU7u J6W+mJ6F4cEKXObh7BYu2PR1mBd9RHevODq4TucONQ7ug3DsWQY+AopTdfnKV6LHLCnK GfugqSyZ+cjdNM8Pi1Z8kax1o2nl68+rvWBoSZQoSrndRihKfnpzodWfdmJKjJ2o7DWd HvVA== X-Gm-Message-State: ALoCoQkcg07BGbyc9jIcJY8jNwsPXjWpF2h+h1/v4pyXCWbo3W4W3xSonfNemxSaX4gV7sshnHJC X-Received: by 10.112.189.131 with SMTP id gi3mr898356lbc.6.1429261204941; Fri, 17 Apr 2015 02:00:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.104 with SMTP id j8ls362863laj.106.gmail; Fri, 17 Apr 2015 02:00:04 -0700 (PDT) X-Received: by 10.112.146.97 with SMTP id tb1mr1731704lbb.12.1429261204795; Fri, 17 Apr 2015 02:00:04 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id qz6si8282959lbb.165.2015.04.17.02.00.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 02:00:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbzk7 with SMTP id zk7so77743810lbb.0 for ; Fri, 17 Apr 2015 02:00:04 -0700 (PDT) X-Received: by 10.113.10.134 with SMTP id ea6mr1647935lbd.29.1429261204706; Fri, 17 Apr 2015 02:00:04 -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.67.65 with SMTP id l1csp3605308lbt; Fri, 17 Apr 2015 02:00:04 -0700 (PDT) X-Received: by 10.55.22.10 with SMTP id g10mr3556654qkh.26.1429261203551; Fri, 17 Apr 2015 02:00:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o8si11091981qcr.4.2015.04.17.02.00.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Apr 2015 02:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:40269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj282-00022W-LE for patch@linaro.org; Fri, 17 Apr 2015 05:00:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj23z-0002Ps-Uo for qemu-devel@nongnu.org; Fri, 17 Apr 2015 04:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj23w-0006sf-4L for qemu-devel@nongnu.org; Fri, 17 Apr 2015 04:55:51 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:36329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj23v-0006sY-VC for qemu-devel@nongnu.org; Fri, 17 Apr 2015 04:55:48 -0400 Received: by pdea3 with SMTP id a3so121834284pde.3 for ; Fri, 17 Apr 2015 01:55:47 -0700 (PDT) X-Received: by 10.66.66.166 with SMTP id g6mr3751693pat.88.1429260947434; Fri, 17 Apr 2015 01:55:47 -0700 (PDT) Received: from pnqlab006.amcc.com ([182.73.239.130]) by mx.google.com with ESMTPSA id za6sm9463127pac.48.2015.04.17.01.55.42 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Apr 2015 01:55:46 -0700 (PDT) From: Pranavkumar Sawargaonkar To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 14:25:10 +0530 Message-Id: <1429260911-24021-2-git-send-email-pranavkumar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1429260911-24021-1-git-send-email-pranavkumar@linaro.org> References: <1429260911-24021-1-git-send-email-pranavkumar@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.182 Cc: peter.maydell@linaro.org, patches@apm.com, agraf@suse.de, Tushar Jagad , pbonzini@redhat.com, christoffer.dall@linaro.org, Pranavkumar Sawargaonkar Subject: [Qemu-devel] [PATCH 1/2] hw: irq: Add API to get irq number from qemu_irq X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: pranavkumar@linaro.org 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.180 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 This patch adds a new function to get irq number from qemu irq. Signed-off-by: Pranavkumar Sawargaonkar Signed-off-by: Tushar Jagad --- hw/core/irq.c | 9 +++++++++ include/hw/irq.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/core/irq.c b/hw/core/irq.c index 8a62a36..0eeffdf 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -35,6 +35,15 @@ struct IRQState { int n; }; +int qemu_get_irq_num(qemu_irq irq) +{ + if (!irq) { + return -1; + } + + return irq->n; +} + void qemu_set_irq(qemu_irq irq, int level) { if (!irq) diff --git a/include/hw/irq.h b/include/hw/irq.h index 4c4c2ea..dd5220c 100644 --- a/include/hw/irq.h +++ b/include/hw/irq.h @@ -9,6 +9,7 @@ typedef struct IRQState *qemu_irq; typedef void (*qemu_irq_handler)(void *opaque, int n, int level); +int qemu_get_irq_num(qemu_irq irq); void qemu_set_irq(qemu_irq irq, int level); static inline void qemu_irq_raise(qemu_irq irq)