From patchwork Thu May 12 22:45:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 9086651 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 370FB9F1C1 for ; Thu, 12 May 2016 22:51:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B0D1201FE for ; Thu, 12 May 2016 22:51:57 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCC1C20142 for ; Thu, 12 May 2016 22:51:56 +0000 (UTC) Received: from localhost ([::1]:60102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0zSV-0001iJ-Va for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 May 2016 18:51:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0zQ8-0006Ag-Ho for qemu-devel@nongnu.org; Thu, 12 May 2016 18:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0zQ3-0002Gt-5s for qemu-devel@nongnu.org; Thu, 12 May 2016 18:49:27 -0400 Received: from mail-bl2nam02on0087.outbound.protection.outlook.com ([104.47.38.87]:20848 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0zQ3-0002Go-1P for qemu-devel@nongnu.org; Thu, 12 May 2016 18:49:23 -0400 Received: from BL2NAM02FT010.eop-nam02.prod.protection.outlook.com (10.152.76.52) by BL2NAM02HT022.eop-nam02.prod.protection.outlook.com (10.152.76.238) with Microsoft SMTP Server (TLS) id 15.1.492.8; Thu, 12 May 2016 22:49:21 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed) header.d=none; linaro.org; dmarc=none action=none header.from=xilinx.com; Received-SPF: Fail (protection.outlook.com: domain of xilinx.com does not designate 149.199.60.96 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.96; helo=xsj-tvapsmtpgw01; Received: from xsj-tvapsmtpgw01 (149.199.60.96) by BL2NAM02FT010.mail.protection.outlook.com (10.152.77.53) with Microsoft SMTP Server (TLS) id 15.1.492.8 via Frontend Transport; Thu, 12 May 2016 22:49:21 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:57332 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1b0zQ0-0007gR-JA; Thu, 12 May 2016 15:49:20 -0700 Received: from [127.0.0.1] (port=37939 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1b0zQ0-0005er-G6; Thu, 12 May 2016 15:49:20 -0700 Received: from xsj-tvapsmtp02 (smtptest.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u4CMh4lK015993; Thu, 12 May 2016 15:43:04 -0700 Received: from [172.19.74.182] (port=36110 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1b0zPz-0005eo-Hu; Thu, 12 May 2016 15:49:19 -0700 From: Alistair Francis To: , Date: Thu, 12 May 2016 15:45:54 -0700 Message-ID: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22316.005 X-TM-AS-Result: No--0.133-7.0-31-10 X-imss-scan-details: No--0.133-7.0-31-10 X-TMASE-MatchedRID: jhJi18RLqAJJOUjEvT0q+2NW0DAjL5p++lX/RcQoG2GcbyawsiRjd6PF jJEFr+ol+S9X7PfvVMrkwjHXXC/4I8ZW5ai5WKlyy//whCOnl1GyPXNI450e0mk4z2VXIKCV1Js RP7z8tlemZhiD8FjzCJ+q4M543nOz/6IF5SnQRhdbB29RYzMQfmVNFWiuK8t4EvHIkTiw57yuyW hshKhPhJeAmGQawnDOW2MLJFJ0g4DiTgmlmLvAEw== X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(5003600100002)(5001770100001)(106466001)(105606002)(2870700001)(229853001)(64026002)(50226002)(50466002)(2906002)(4326007)(1220700001)(189998001)(33646002)(5820100001)(36756003)(81166006)(71366001)(586003)(9786002)(8936002)(86362001)(47776003)(77096005)(23676002)(118296001)(11100500001)(92566002)(85426001)(19580405001)(5008740100001)(2950100001)(6806005)(19580395003)(87936001)(76176999)(50986999)(427584002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2NAM02HT022; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-MS-Office365-Filtering-Correlation-Id: 56821132-c16e-497a-a6d7-08d37ab7a881 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT022; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(8121501046)(13024025)(13017025)(5005006)(13023025)(13018025)(3002001)(10201501046)(6055026); SRVR:BL2NAM02HT022; BCL:0; PCL:0; RULEID:; SRVR:BL2NAM02HT022; X-Forefront-PRVS: 0940A19703 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2016 22:49:21.2169 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.96]; Helo=[xsj-tvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT022 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.87 Subject: [Qemu-devel] [PATCH v6 01/13] bitops: Add MAKE_64BIT_MASK macro 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: 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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