From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGbL-0003vh-TX for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTGbG-00011P-S9 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:39 -0500 Received: from mail-bl2nam02on0080.outbound.protection.outlook.com ([104.47.38.80]:39168 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGbG-00010z-N2 for qemu-devel@nongnu.org; Tue, 09 Feb 2016 17:17:34 -0500 From: Alistair Francis Date: Tue, 9 Feb 2016 14:14:55 -0800 Message-ID: <889f6c7641bb04403de2a03406177dcf24ca8a53.1455055858.git.alistair.francis@xilinx.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v4 08/16] bitops: Add ONES macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: edgar.iglesias@xilinx.com, alistair.francis@xilinx.com, crosthwaitepeter@gmail.com, edgar.iglesias@gmail.com, alex.bennee@linaro.org, afaerber@suse.de, fred.konrad@greensocs.com From: Peter Crosthwaite Little macro that just gives you N ones (justified to LSB). Signed-off-by: Peter Crosthwaite Signed-off-by: Alistair Francis --- include/qemu/bitops.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index 8164225..27bf98d 100644 --- a/include/qemu/bitops.h +++ b/include/qemu/bitops.h @@ -430,4 +430,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 -- 2.5.0