From patchwork Tue Jul 5 20:30:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 9215193 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7AE7760572 for ; Tue, 5 Jul 2016 20:32:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CCFB28418 for ; Tue, 5 Jul 2016 20:32:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 605B02841A; Tue, 5 Jul 2016 20:32:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C466928418 for ; Tue, 5 Jul 2016 20:32:54 +0000 (UTC) Received: from localhost ([::1]:57914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKX1Z-0004xD-Ua for patchwork-qemu-devel@patchwork.kernel.org; Tue, 05 Jul 2016 16:32:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKWzh-0003w9-Ee for qemu-devel@nongnu.org; Tue, 05 Jul 2016 16:30:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKWze-00038h-Mn for qemu-devel@nongnu.org; Tue, 05 Jul 2016 16:30:57 -0400 Received: from mail-bl2nam02on0040.outbound.protection.outlook.com ([104.47.38.40]:11040 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKWze-00038M-GR for qemu-devel@nongnu.org; Tue, 05 Jul 2016 16:30:54 -0400 Received: from BL2NAM02FT041.eop-nam02.prod.protection.outlook.com (10.152.76.51) by BL2NAM02HT213.eop-nam02.prod.protection.outlook.com (10.152.76.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.534.7; Tue, 5 Jul 2016 20:30:52 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BL2NAM02FT041.mail.protection.outlook.com (10.152.77.122) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.534.7 via Frontend Transport; Tue, 5 Jul 2016 20:30:52 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:48373 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1bKWzb-00042j-De; Tue, 05 Jul 2016 13:30:51 -0700 Received: from [127.0.0.1] (port=57213 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1bKWzb-0000G5-AF; Tue, 05 Jul 2016 13:30:51 -0700 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u65KOEIo013309; Tue, 5 Jul 2016 13:24:14 -0700 Received: from [172.19.74.182] (port=36090 helo=xsjalistai50.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1bKWza-0000G2-C1; Tue, 05 Jul 2016 13:30:50 -0700 From: Alistair Francis To: Date: Tue, 5 Jul 2016 13:30:31 -0700 Message-ID: <97460953879995f94eed6a04d2489291d7e2091b.1467746249.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22432.005 X-TM-AS-Result: No--2.972-7.0-31-10 X-imss-scan-details: No--2.972-7.0-31-10 X-TMASE-MatchedRID: yWYOB9VwmhlGlhjnipkGEBWCVBr+Ay98DiUf/hQuYYVtw+n+iKWyyMRk oeJ3OFRcFXq3kuUpln++daZEFcM/u2+sGcdbpdKcngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIcSq bxBgG0w5DVAShqJkPRN/palwNS5nwSIg9S27WniYn62ueLH4zwYJ/23a7Pcc0zA2EipN2+bz0vr mnojIAL5GlAWN5kpTGnnlDN3w344GCvqWrFsheUcLe0zBjeZrbFQOP52BRBXJMTsKj18q/fA== X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.96; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(77096005)(81166006)(19580395003)(19580405001)(575784001)(189998001)(2351001)(47776003)(86362001)(7696003)(5003600100003)(586003)(229853001)(87936001)(81156014)(85426001)(118296001)(64026002)(11100500001)(8936002)(71366001)(2906002)(110136002)(356003)(106466001)(50986999)(5003940100001)(36756003)(50226002)(33646002)(50466002)(4326007)(7846002)(8676002)(48376002)(105606002)(305945005)(9786002)(76176999)(92566002)(2950100001)(107986001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT213; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; PTR:unknown-60-96.xilinx.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b24d389c-29cf-408d-4f6f-08d3a513422a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT213; X-Microsoft-Antispam-PRVS: <19e54923ff70484aae05586c48fbc1b3@BL2NAM02HT213.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13023025)(13015025)(13018025)(8121501046)(13017025)(5005006)(3002001)(10201501046)(6055026); SRVR:BL2NAM02HT213; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT213; X-Forefront-PRVS: 0994F5E0C5 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2016 20:30:52.0683 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT213 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.40 Subject: [Qemu-devel] [PATCH v1 1/4] irq: Add opaque setter routine 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Crosthwaite Add a routine to set or override the opaque data of an IRQ. Qdev currently always initialises IRQ opaque as the device itself. This allows you to override to a custom opaque in the case where there is extra or different data needed. Signed-off-by: Peter Crosthwaite Signed-off-by: Alistair Francis --- hw/core/irq.c | 5 +++++ include/hw/irq.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/core/irq.c b/hw/core/irq.c index 49ff2e6..9d125fb 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -77,6 +77,11 @@ qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque, int n) return irq; } +void qemu_irq_set_opaque(qemu_irq irq, void *opaque) +{ + irq->opaque = opaque; +} + void qemu_free_irqs(qemu_irq *s, int n) { int i; diff --git a/include/hw/irq.h b/include/hw/irq.h index 4c4c2ea..edad0fc 100644 --- a/include/hw/irq.h +++ b/include/hw/irq.h @@ -44,6 +44,8 @@ qemu_irq qemu_allocate_irq(qemu_irq_handler handler, void *opaque, int n); qemu_irq *qemu_extend_irqs(qemu_irq *old, int n_old, qemu_irq_handler handler, void *opaque, int n); +void qemu_irq_set_opaque(qemu_irq irq, void *opaque); + void qemu_free_irqs(qemu_irq *s, int n); void qemu_free_irq(qemu_irq irq);