From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: qemu-devel@nongnu.org
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
peter.maydell@linaro.org, richard.henderson@linaro.org
Subject: [Qemu-devel] [PATCH RFC v6 12/12] include/hw/regiserfields.h: Add 8bit and 16bit registers
Date: Mon, 1 Apr 2019 23:03:18 +0900 [thread overview]
Message-ID: <20190401140318.80498-13-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <20190401140318.80498-1-ysato@users.sourceforge.jp>
Some RX peripheral using 8bit and 16bit registers.
Added 8bit and 16bit APIs.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
include/hw/registerfields.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/hw/registerfields.h b/include/hw/registerfields.h
index 2659a58737..f6bf911990 100644
--- a/include/hw/registerfields.h
+++ b/include/hw/registerfields.h
@@ -22,6 +22,14 @@
enum { A_ ## reg = (addr) }; \
enum { R_ ## reg = (addr) / 4 };
+#define REG8(reg, addr) \
+ enum { A_ ## reg = (addr) }; \
+ enum { R_ ## reg = (addr) };
+
+#define REG16(reg, addr) \
+ enum { A_ ## reg = (addr) }; \
+ enum { R_ ## reg = (addr) / 2 };
+
/* Define SHIFT, LENGTH and MASK constants for a field within a register */
/* This macro will define R_FOO_BAR_MASK, R_FOO_BAR_SHIFT and R_FOO_BAR_LENGTH
@@ -40,6 +48,8 @@
#define FIELD_EX64(storage, reg, field) \
extract64((storage), R_ ## reg ## _ ## field ## _SHIFT, \
R_ ## reg ## _ ## field ## _LENGTH)
+#define FIELD_EX8 FIELD_EX32
+#define FIELD_EX16 FIELD_EX32
/* Extract a field from an array of registers */
#define ARRAY_FIELD_EX32(regs, reg, field) \
--
2.11.0
next prev parent reply other threads:[~2019-04-01 14:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190325090047.122981-1-ysato@users.sourceforge.jp>
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 00/12] Add RX archtecture support Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 01/12] target/rx: TCG translation Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 02/12] target/rx: TCG helper Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 03/12] target/rx: CPU definition Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 04/12] target/rx: RX disassembler Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 05/12] target/rx: Miscellaneous files Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 06/12] hw/intc: RX62N interrupt controller (ICUa) Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 07/12] hw/timer: RX62N internal timer modules Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 08/12] hw/char: RX62N serical communication interface (SCI) Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 09/12] hw/rx: RX Target hardware definition Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 10/12] Add rx-softmmu Yoshinori Sato
2019-04-01 14:03 ` [Qemu-devel] [PATCH RFC v6 11/12] MAINTAINERS: Add RX Yoshinori Sato
2019-04-01 14:03 ` Yoshinori Sato [this message]
2019-04-11 10:09 ` [Qemu-devel] [PATCH RFC v6 12/12] include/hw/regiserfields.h: Add 8bit and 16bit registers Philippe Mathieu-Daudé
2019-04-14 14:55 ` Yoshinori Sato
2019-04-14 14:55 ` Yoshinori Sato
2019-04-01 15:35 ` [Qemu-devel] [PATCH RFC v6 00/12] Add RX archtecture support no-reply
2019-04-11 10:15 ` Philippe Mathieu-Daudé
2019-04-12 13:27 ` Yoshinori Sato
2019-04-12 13:27 ` Yoshinori Sato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190401140318.80498-13-ysato@users.sourceforge.jp \
--to=ysato@users.sourceforge.jp \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.