From patchwork Tue Jan 19 22:35:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 8065311 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A46C49F96D for ; Tue, 19 Jan 2016 22:39:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 150B22052A for ; Tue, 19 Jan 2016 22:39:30 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 5E17920456 for ; Tue, 19 Jan 2016 22:39:29 +0000 (UTC) Received: from localhost ([::1]:39474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLevw-00039y-N6 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Jan 2016 17:39:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLeuC-0000J1-7C for qemu-devel@nongnu.org; Tue, 19 Jan 2016 17:37:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLeu9-0003oT-1g for qemu-devel@nongnu.org; Tue, 19 Jan 2016 17:37:40 -0500 Received: from mail-bl2nam02on0057.outbound.protection.outlook.com ([104.47.38.57]:44888 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLeu8-0003oC-SN for qemu-devel@nongnu.org; Tue, 19 Jan 2016 17:37:36 -0500 Received: from SN1NAM02FT016.eop-nam02.prod.protection.outlook.com (10.152.72.56) by SN1NAM02HT072.eop-nam02.prod.protection.outlook.com (10.152.72.225) with Microsoft SMTP Server (TLS) id 15.1.355.15; Tue, 19 Jan 2016 22:37:35 +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 SN1NAM02FT016.mail.protection.outlook.com (10.152.72.113) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Tue, 19 Jan 2016 22:37:34 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:34416 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aLeu3-0008Qf-GZ; Tue, 19 Jan 2016 14:37:31 -0800 Received: from [127.0.0.1] (port=41635 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aLeu3-0007gE-AM; Tue, 19 Jan 2016 14:37:31 -0800 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 u0JMVv60015225; Tue, 19 Jan 2016 14:31:58 -0800 Received: from [172.19.74.182] (port=39708 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aLeu2-0007gB-E7; Tue, 19 Jan 2016 14:37:30 -0800 From: Alistair Francis To: Date: Tue, 19 Jan 2016 14:35:04 -0800 Message-ID: X-Mailer: git-send-email 2.5.0 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-22054.006 X-TM-AS-Result: No--0.376-7.0-31-10 X-imss-scan-details: No--0.376-7.0-31-10 X-TMASE-MatchedRID: 5e4uYa+cgEP/uyguzMmOKI6MisxJraxHesw8RnBRGwp+CPuoK+vfzWWa +qypoBhr0JBo+IVTgnH8I8AIZZ2s3jcsFptIKouY3fn7n/ZHGqYK/ePvB1fEGJsoi2XrUn/Jn6K dMrRsL14qtq5d3cxkNSSFZxwBH+WRvYqdacNbFSgj+iF7JHItKD6LA0oTk1bXW8horEeClECS4u EsAIPHBL1Ww+81km526e0rG/fe2hGbxnjQB3XJwYByMfv2BEtbU8mdcvbI1h2S6jzjuXTm0MTMz ICazP4UehYtaVdyxm8= X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(118296001)(47776003)(50226001)(11100500001)(6806005)(2351001)(5003600100002)(81156007)(64026002)(110136002)(106466001)(2950100001)(77096005)(189998001)(19580395003)(92566002)(4001430100002)(33646002)(5001960100002)(50986999)(107886002)(229853001)(2906002)(87936001)(19580405001)(71366001)(76176999)(5008740100001)(85426001)(36756003)(5003940100001)(48376002)(586003)(86362001)(4326007)(1220700001)(50466002)(1096002)(105606002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT072; 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: ef813a57-61b3-4286-122f-08d321212050 X-Exchange-Antispam-Report-Test: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT072; UriScan:(192813158149592); X-Microsoft-Antispam-PRVS: <66f8c80927b0492f91299abe8583163f@SN1NAM02HT072.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(13018025)(13017025)(8121501046)(13024025)(5005006)(13015025)(13023025)(10201501046)(3002001); SRVR:SN1NAM02HT072; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT072; X-Forefront-PRVS: 0826B2F01B X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2016 22:37:34.7565 (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: SN1NAM02HT072 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.57 Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v2 04/16] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Crosthwaite 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 Signed-off-by: Alistair Francis --- 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; }; /**