From nobody Sun Feb 8 10:33:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554127807722988.892713481623; Mon, 1 Apr 2019 07:10:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:33329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAxdU-0002F0-JK for importer@patchew.org; Mon, 01 Apr 2019 10:10:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAxXJ-0005fq-Ui for qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:03:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAxXI-0000m8-C7 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:03:41 -0400 Received: from mail03.asahi-net.or.jp ([202.224.55.15]:58711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAxXH-0000l5-U3 for qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:03:40 -0400 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.vps.ablenet.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail03.asahi-net.or.jp (Postfix) with ESMTPA id 38A0538178; Mon, 1 Apr 2019 23:03:39 +0900 (JST) Received: from ysato.dip.jp (e143087.dynamic.ppp.asahi-net.or.jp [211.13.143.87]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 8EEBE240096; Mon, 1 Apr 2019 23:03:38 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Date: Mon, 1 Apr 2019 23:03:18 +0900 Message-Id: <20190401140318.80498-13-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190401140318.80498-1-ysato@users.sourceforge.jp> References: <20190325090047.122981-1-ysato@users.sourceforge.jp> <20190401140318.80498-1-ysato@users.sourceforge.jp> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.15 Subject: [Qemu-devel] [PATCH RFC v6 12/12] include/hw/regiserfields.h: Add 8bit and 16bit registers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, richard.henderson@linaro.org, Yoshinori Sato Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Some RX peripheral using 8bit and 16bit registers. Added 8bit and 16bit APIs. Signed-off-by: Yoshinori Sato --- 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 =3D (addr) }; = \ enum { R_ ## reg =3D (addr) / 4 }; =20 +#define REG8(reg, addr) \ + enum { A_ ## reg =3D (addr) }; = \ + enum { R_ ## reg =3D (addr) }; + +#define REG16(reg, addr) \ + enum { A_ ## reg =3D (addr) }; = \ + enum { R_ ## reg =3D (addr) / 2 }; + /* Define SHIFT, LENGTH and MASK constants for a field within a register */ =20 /* This macro will define R_FOO_BAR_MASK, R_FOO_BAR_SHIFT and R_FOO_BAR_LE= NGTH @@ -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 =20 /* Extract a field from an array of registers */ #define ARRAY_FIELD_EX32(regs, reg, field) \ --=20 2.11.0