From patchwork Mon Apr 27 21:58:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 465223 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 E433814012C for ; Tue, 28 Apr 2015 07:58:51 +1000 (AEST) Received: from localhost ([::1]:57767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymr3A-0003Dp-L8 for incoming@patchwork.ozlabs.org; Mon, 27 Apr 2015 17:58:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymr2a-0001y5-Ba for qemu-devel@nongnu.org; Mon, 27 Apr 2015 17:58:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymr2U-00039R-70 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 17:58:12 -0400 Received: from mail-by2on0059.outbound.protection.outlook.com ([207.46.100.59]:29545 helo=na01-by2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymr2T-000396-UD for qemu-devel@nongnu.org; Mon, 27 Apr 2015 17:58:06 -0400 Received: from BN1BFFO11FD031.protection.gbl (10.58.144.31) by BN1BFFO11HUB035.protection.gbl (10.58.144.182) with Microsoft SMTP Server (TLS) id 15.1.154.14; Mon, 27 Apr 2015 21:58:03 +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; 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 BN1BFFO11FD031.mail.protection.outlook.com (10.58.144.94) with Microsoft SMTP Server (TLS) id 15.1.154.14 via Frontend Transport; Mon, 27 Apr 2015 21:58:03 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:46782 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1Ymqxe-0003V6-9t; Mon, 27 Apr 2015 14:53:06 -0700 Received: from [127.0.0.1] (port=56632 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1Ymr2Q-0005Mh-92; Mon, 27 Apr 2015 14:58:02 -0700 Received: from xsj-tvapsmtp02 (xsj-tvapsmtp02.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id t3RLrvLn016802; Mon, 27 Apr 2015 14:53:57 -0700 Received: from [172.19.74.49] (port=48026 helo=xsjsorenbubuntu.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1Ymr2O-0005MW-Ql; Mon, 27 Apr 2015 14:58:00 -0700 From: Peter Crosthwaite To: Date: Mon, 27 Apr 2015 14:58:00 -0700 Message-ID: X-Mailer: git-send-email 2.3.6.3.g2cc70ee In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-7.5.0.1018-21506.005 X-TM-AS-Result: No--2.800-7.0-31-10 X-imss-scan-details: No--2.800-7.0-31-10 X-TMASE-MatchedRID: 5e4uYa+cgEP9kbyhKg6JlJN3sInxtjDT+eBf9ovw8I2bQheSHWffIHm8 t2ifVKz30JBo+IVTgnH8I8AIZZ2s3jcsFptIKouY3fn7n/ZHGqYK/ePvB1fEGJsoi2XrUn/Jn6K dMrRsL14qtq5d3cxkNT87o4uFUdFR5bFgn5jMQ/KhC1XPvw1PBsDVr6zWxPhm0s6eTe86zWIobp v1GpPIDqkYjroy1M4G9lKXGVNe+Rz7VYyF9h31ddctSarHnY/EU8mdcvbI1h2S6jzjuXTm0MTMz ICazP4UehYtaVdyxm8= X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; BMV:1; SFV:NSPM; SFS:(10009020)(6009001)(339900001)(199003)(189002)(46102003)(2950100001)(36756003)(33646002)(118296001)(77156002)(6806004)(62966003)(92566002)(77096005)(87936001)(86362001)(48376002)(85426001)(2351001)(229853001)(76176999)(105606002)(110136001)(106466001)(19580405001)(47776003)(19580395003)(50466002)(64026002)(50226001)(50986999)(71366001)(107986001)(4001430100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN1BFFO11HUB035; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1BFFO11HUB035; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010)(3002001); SRVR:BN1BFFO11HUB035; BCL:0; PCL:0; RULEID:; SRVR:BN1BFFO11HUB035; X-Forefront-PRVS: 0559FB9674 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2015 21:58:03.4164 (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: BN1BFFO11HUB035 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 207.46.100.59 Cc: peter.maydell@linaro.org, zachp@xilinx.com, jues@xilinx.com, edgari@xilinx.com, kraxel@redhat.com, edgar.iglesias@gmail.com Subject: [Qemu-devel] [RFC PATCH v5 03/14] register: Add support for decoding information 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Allow defining of optional address decoding information in register definitions. This is useful for clients that want to associate registers with specific addresses. Signed-off-by: Peter Crosthwaite --- changed since v4: Remove extraneous unused defintions. include/hw/register.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hw/register.h b/include/hw/register.h index a3c41db..90c0185 100644 --- a/include/hw/register.h +++ b/include/hw/register.h @@ -54,6 +54,11 @@ typedef struct RegisterAccessError { * allowing this function to modify the value before return to the client. */ +#define REG_DECODE_READ (1 << 0) +#define REG_DECODE_WRITE (1 << 1) +#define REG_DECODE_EXECUTE (1 << 2) +#define REG_DECODE_RW (REG_DECODE_READ | REG_DECODE_WRITE) + struct RegisterAccessInfo { const char *name; uint64_t ro; @@ -71,6 +76,11 @@ struct RegisterAccessInfo { void (*post_write)(RegisterInfo *reg, uint64_t val); uint64_t (*post_read)(RegisterInfo *reg, uint64_t val); + + struct { + hwaddr addr; + uint8_t flags; + } decode; }; /**