From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiOCr-0004PR-Pd for qemu-devel@nongnu.org; Tue, 22 Mar 2016 11:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiOCn-0001zC-0S for qemu-devel@nongnu.org; Tue, 22 Mar 2016 11:26:53 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:37904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiOCm-0001ys-NC for qemu-devel@nongnu.org; Tue, 22 Mar 2016 11:26:48 -0400 Received: by mail-wm0-x22f.google.com with SMTP id l68so168900340wml.1 for ; Tue, 22 Mar 2016 08:26:48 -0700 (PDT) References: <912f91bdbccf665fddd51b186027a3ae702d768a.1457470980.git.alistair.francis@xilinx.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <912f91bdbccf665fddd51b186027a3ae702d768a.1457470980.git.alistair.francis@xilinx.com> Date: Tue, 22 Mar 2016 15:26:46 +0000 Message-ID: <87a8lqsfd5.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v5 01/15] bitops: Add MAKE_64BIT_MASK macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, qemu-devel@nongnu.org, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, afaerber@suse.de, fred.konrad@greensocs.com Alistair Francis writes: > Add a macro that creates a 64bit value which has length number of ones > shifted acrros by the value of shift. > > Signed-off-by: Alistair Francis Reviewed-by: Alex Bennée > --- > V5: > - Re-write to a 64-bit mask instead of ONES() > - Re-order this patch in the series > > include/qemu/bitops.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h > index 755fdd1..3c45791 100644 > --- a/include/qemu/bitops.h > +++ b/include/qemu/bitops.h > @@ -24,6 +24,9 @@ > #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) > #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) > > +#define MAKE_64BIT_MASK(shift, length) \ > + (((1ull << (length)) - 1) << shift) > + > /** > * set_bit - Set a bit in memory > * @nr: the bit to set -- Alex Bennée