From patchwork Sat Jul 23 16:42:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 651995 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rxYRH5kJkz9syB for ; Sun, 24 Jul 2016 02:50:19 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=047jKKVQ; dkim-atps=neutral Received: from localhost ([::1]:53004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR081-00077o-5D for incoming@patchwork.ozlabs.org; Sat, 23 Jul 2016 12:50:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR00T-0000UX-HK for qemu-devel@nongnu.org; Sat, 23 Jul 2016 12:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR00R-0006gr-Rb for qemu-devel@nongnu.org; Sat, 23 Jul 2016 12:42:28 -0400 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:33584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR00R-0006gl-Kh for qemu-devel@nongnu.org; Sat, 23 Jul 2016 12:42:27 -0400 Received: by mail-pa0-x244.google.com with SMTP id q2so8689981pap.0 for ; Sat, 23 Jul 2016 09:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=P+EMXRJOfKW5k2pa9ykJEfauRUrDpT5JT05z43Pjwdc=; b=047jKKVQQmX79AZ+JL4bz/Zcg8toPEJyXKUm7bWfLJ08zgaRKcOF0Hef81MrDFF4wm Gx3b/m1rDLcZlSiBJK0Ms4b+UtvTR8JkWtoqCjDfYnbL5xMJbQR7OYVXNQv3UZnxRSMz JJvq8tgMTghcULunZ0QY4LnQ5us8mlm05oqkeO0PXmyF0yStbbGBASLVOTbVCsMzy/Nh i6zVxxb3VaFAZfv1A6XKn5Rh6/i71NVUlOKZjjN0TfiB+xQ5gWBrIng8S/HVHyl2pBOw ckvZq1fsY0o1MARDvb623+ha+cWNApd0sm5bIfe8Yi1HKCsGNqf15NHOmJ8xv/+pJbdN xpPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P+EMXRJOfKW5k2pa9ykJEfauRUrDpT5JT05z43Pjwdc=; b=OvPPeX7EkHCR+Cq5gHyb1gXpwq/yMlzwYOqy0ZN9ulDApITsbhCqbvXekGh3Y6Ar9p aOG/jzTs0Y71xopiS5R3aoTmOdqf6KWBXufG7JSouR8mm1dcpPhLaTCCNCxQ1LbhEx83 G9gQ4kL9jHbXMd8iiymJpxjNZAAubzj938caiWBAUOT5mmg4UjvyOLAdlobNDIStOK0S qr1bWSgUpwweULphZx3CozVL0bxuyqvDbxbGNo+bL+31DLJ6sJ02CoN6kYnb6E1/UPua Bu4qojrN/tB31aRzYQ5uyRM+lcCwrQV9exIO9NX3hxwVGvNV/MNNSx/QBPWFSVGNWyTc qaIw== X-Gm-Message-State: AEkoouuqHBJ2QYJpXJFySg6U1tnuf2lAZ8vtnnh/OnuEz25ZCO+rD9GI/FNbQJYM4NawpQ== X-Received: by 10.66.13.200 with SMTP id j8mr16001638pac.150.1469292146840; Sat, 23 Jul 2016 09:42:26 -0700 (PDT) Received: from localhost ([2601:646:8581:937e:a68a:c69f:cf0b:ebee]) by smtp.gmail.com with ESMTPSA id q1sm28273976pfd.48.2016.07.23.09.42.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jul 2016 09:42:26 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Sat, 23 Jul 2016 09:42:25 -0700 Message-Id: <6fce8937eb65cdfa880d87c3389a550360bdd87f.1469258908.git.alistair@alistair23.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::244 Subject: [Qemu-devel] [PATCH v4 5/8] irq: Add irq information getter functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, peter.crosthwaite@xilinx.com, konstanty@ieee.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add two functions one to get the irq handler function and another to get the opaque data from a qemu_irq. Signed-off-by: Alistair Francis --- hw/core/irq.c | 10 ++++++++++ include/hw/irq.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/hw/core/irq.c b/hw/core/irq.c index 49ff2e6..026200e 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -91,6 +91,16 @@ void qemu_free_irq(qemu_irq irq) object_unref(OBJECT(irq)); } +qemu_irq_handler qemu_irq_get_handler(qemu_irq irq) +{ + return irq->handler; +} + +void *qemu_irq_get_opaque(qemu_irq irq) +{ + return irq->opaque; +} + static void qemu_notirq(void *opaque, int line, int level) { struct IRQState *irq = opaque; diff --git a/include/hw/irq.h b/include/hw/irq.h index 4c4c2ea..934a8f5 100644 --- a/include/hw/irq.h +++ b/include/hw/irq.h @@ -27,6 +27,10 @@ static inline void qemu_irq_pulse(qemu_irq irq) qemu_set_irq(irq, 0); } +qemu_irq_handler qemu_irq_get_handler(qemu_irq irq); + +void *qemu_irq_get_opaque(qemu_irq irq); + /* Returns an array of N IRQs. Each IRQ is assigned the argument handler and * opaque data. */