From patchwork Tue Feb 9 22:14:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 581093 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 0204C140BA2 for ; Wed, 10 Feb 2016 09:20:24 +1100 (AEDT) Received: from localhost ([::1]:32951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGdx-0008R5-Vq for incoming@patchwork.ozlabs.org; Tue, 09 Feb 2016 17:20:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGbB-0003ei-Ml for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTGb6-0000xP-RC for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:29 -0500 Received: from mail-sn1nam02on0072.outbound.protection.outlook.com ([104.47.36.72]:64024 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGb6-0000xG-K0 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:24 -0500 Received: from BL2NAM02FT061.eop-nam02.prod.protection.outlook.com (10.152.76.53) by BL2NAM02HT053.eop-nam02.prod.protection.outlook.com (10.152.76.87) with Microsoft SMTP Server (TLS) id 15.1.409.7; Tue, 9 Feb 2016 22:17:23 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; 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 BL2NAM02FT061.mail.protection.outlook.com (10.152.77.7) with Microsoft SMTP Server (TLS) id 15.1.409.7 via Frontend Transport; Tue, 9 Feb 2016 22:17:23 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:35347 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aTGb4-0002mU-7p; Tue, 09 Feb 2016 14:17:22 -0800 Received: from [127.0.0.1] (port=42566 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aTGb4-0007aC-2F; Tue, 09 Feb 2016 14:17:22 -0800 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 u19MBfxC011537; Tue, 9 Feb 2016 14:11:41 -0800 Received: from [172.19.74.182] (port=49718 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aTGb3-0007a9-6J; Tue, 09 Feb 2016 14:17:21 -0800 From: Alistair Francis To: , Date: Tue, 9 Feb 2016 14:14:46 -0800 Message-ID: <1257121e8355d27ffdade6e952df3affbfcb4773.1455055858.git.alistair.francis@xilinx.com> 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.321-7.0-31-10 X-imss-scan-details: No-0.321-7.0-31-10 X-TMASE-MatchedRID: +aiIZkdJNeX/uyguzMmOKI6MisxJraxHesw8RnBRGwp+CPuoK+vfzWWa +qypoBhrPkLPiTrkPiLkT1ug+sI9d+SVcWGqSjBgxEwSTOeVUQ67nrAU9KQxUUbqb+WBsolSo8W MkQWv6iXBcIE78YqRWo6HM5rqDwqtPT6AzPYuKGN4J7mdhz969FbBxrv/R1HTwiiRRAMDoxaWOn lx8ErapzU6PvKJhrNIvp+xaBxpMS6GBCTOFU510GlaRahbEyQaHSbhGbmGylXFJK7yLnZRGZdO3 Q67ImL8gi4RUz90EQyPE3z9EHUWeJRMZUCEHkRt 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)(189002)(199003)(2906002)(36756003)(106466001)(4326007)(33646002)(5001770100001)(229853001)(50226001)(19580405001)(85426001)(48376002)(50466002)(19580395003)(105606002)(64026002)(118296001)(189998001)(87936001)(86362001)(11100500001)(5003600100002)(586003)(1220700001)(2950100001)(92566002)(47776003)(1096002)(6806005)(5003940100001)(50986999)(76176999)(5008740100001)(5001960100002)(77096005)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT053; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 16f93a6c-4132-4753-2174-08d3319ec8bf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT053; X-Microsoft-Antispam-PRVS: <0dda89d1fe3e40fc85913b4cd0133de0@BL2NAM02HT053.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)(8121501046)(13024025)(13015025)(13018025)(13017025)(5005006)(13023025)(3002001)(10201501046); SRVR:BL2NAM02HT053; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT053; X-Forefront-PRVS: 08476BC6EF X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2016 22:17:23.0059 (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: BL2NAM02HT053 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.72 Cc: edgar.iglesias@xilinx.com, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, alex.bennee@linaro.org, afaerber@suse.de, fred.konrad@greensocs.com Subject: [Qemu-devel] [PATCH v4 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- V3: - Remove unused flags option include/hw/register.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/hw/register.h b/include/hw/register.h index 9aa9cfc..29edb5b 100644 --- a/include/hw/register.h +++ b/include/hw/register.h @@ -41,6 +41,11 @@ typedef struct RegisterAccessInfo RegisterAccessInfo; * 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; @@ -54,6 +59,10 @@ struct RegisterAccessInfo { void (*post_write)(RegisterInfo *reg, uint64_t val); uint64_t (*post_read)(RegisterInfo *reg, uint64_t val); + + struct { + hwaddr addr; + } decode; }; /**