From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, kraxel@redhat.com, edgar.iglesias@gmail.com
Subject: [Qemu-devel] [PATCH v4 1/6] bitops: Add ONES macro
Date: Wed, 9 Apr 2014 00:15:39 -0700 [thread overview]
Message-ID: <15df2dad3642550b1e41604aa5f8284dc5dfb83b.1397024123.git.peter.crosthwaite@xilinx.com> (raw)
In-Reply-To: <cover.1397024123.git.peter.crosthwaite@xilinx.com>
Little macro that just gives you N ones (justified to LSB).
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
include/qemu/bitops.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
index 340b1e7..b9fd60f 100644
--- a/include/qemu/bitops.h
+++ b/include/qemu/bitops.h
@@ -403,4 +403,6 @@ static inline uint64_t deposit64(uint64_t value, int start, int length,
return (value & ~mask) | ((fieldval << start) & mask);
}
+#define ONES(num) ((num) == 64 ? ~0ull : (1ull << (num)) - 1)
+
#endif
--
1.9.1.1.gbb9f595
next prev parent reply other threads:[~2014-04-09 7:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 7:15 [Qemu-devel] [PATCH v4 0/6] Data Driven device registers + Zynq DEVCFG Peter Crosthwaite
2014-04-09 7:15 ` Peter Crosthwaite [this message]
2014-04-09 7:16 ` [Qemu-devel] [PATCH v4 2/6] register: Add Register API Peter Crosthwaite
2014-04-09 7:16 ` [Qemu-devel] [PATCH v4 3/6] register: Add Memory API glue Peter Crosthwaite
2014-04-09 7:17 ` [Qemu-devel] [PATCH v4 4/6] register: Add support for decoding information Peter Crosthwaite
2014-04-09 7:18 ` [Qemu-devel] [PATCH v4 5/6] xilinx_devcfg: Zynq devcfg device model Peter Crosthwaite
2014-04-09 7:18 ` [Qemu-devel] [PATCH v4 6/6] xilinx_zynq: added devcfg to machine model Peter Crosthwaite
[not found] ` <CAEgOgz44H0wneRDxUrsvtLNtVD3iNAfL28VmAhYURGG95kh93g@mail.gmail.com>
2014-05-05 23:42 ` [Qemu-devel] [PATCH v4 0/6] Data Driven device registers + Zynq DEVCFG Peter Crosthwaite
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=15df2dad3642550b1e41604aa5f8284dc5dfb83b.1397024123.git.peter.crosthwaite@xilinx.com \
--to=peter.crosthwaite@xilinx.com \
--cc=edgar.iglesias@gmail.com \
--cc=kraxel@redhat.com \
--cc=peter.maydell@linaro.org \
--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).