From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Alistair Francis Date: Tue, 9 Feb 2016 14:14:46 -0800 Message-ID: <1257121e8355d27ffdade6e952df3affbfcb4773.1455055858.git.alistair.francis@xilinx.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v4 04/16] register: Add support for decoding information List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org 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 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; }; /** -- 2.5.0