qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Joe Komlodi <joe.komlodi@xilinx.com>
To: <qemu-devel@nongnu.org>
Cc: alistair@alistair23.me
Subject: [PATCH 2/2] hw/registerfields: Use 64-bit bitfield for FIELD_DP64
Date: Mon, 19 Jul 2021 13:16:23 -0700	[thread overview]
Message-ID: <1626725783-133765-3-git-send-email-joe.komlodi@xilinx.com> (raw)
In-Reply-To: <1626725783-133765-1-git-send-email-joe.komlodi@xilinx.com>

If we have a field that's wider than 32-bits, we need a data type wide enough to
be able to create the bitfield used to deposit the value.

Signed-off-by: Joe Komlodi <joe.komlodi@xilinx.com>
---
 include/hw/registerfields.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/registerfields.h b/include/hw/registerfields.h
index 9a03ac5..f7bfa1f 100644
--- a/include/hw/registerfields.h
+++ b/include/hw/registerfields.h
@@ -95,7 +95,7 @@
     _d; })
 #define FIELD_DP64(storage, reg, field, val) ({                           \
     struct {                                                              \
-        unsigned int v:R_ ## reg ## _ ## field ## _LENGTH;                \
+        unsigned long v:R_ ## reg ## _ ## field ## _LENGTH;                \
     } _v = { .v = val };                                                  \
     uint64_t _d;                                                          \
     _d = deposit64((storage), R_ ## reg ## _ ## field ## _SHIFT,          \
-- 
2.7.4



  parent reply	other threads:[~2021-07-19 20:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 20:16 [PATCH 0/2] hw/core/register: Add more 64-bit utilities Joe Komlodi
2021-07-19 20:16 ` [PATCH 1/2] " Joe Komlodi
2021-07-19 20:16 ` Joe Komlodi [this message]
2021-07-19 21:31   ` [PATCH 2/2] hw/registerfields: Use 64-bit bitfield for FIELD_DP64 Richard Henderson

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=1626725783-133765-3-git-send-email-joe.komlodi@xilinx.com \
    --to=joe.komlodi@xilinx.com \
    --cc=alistair@alistair23.me \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).