From patchwork Tue Feb 9 22:14:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 8266101 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22248BEEE5 for ; Tue, 9 Feb 2016 22:22:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 65C5220260 for ; Tue, 9 Feb 2016 22:22:16 +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 B87AF20218 for ; Tue, 9 Feb 2016 22:22:15 +0000 (UTC) Received: from localhost ([::1]:32964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTGfn-0002Rr-1V for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Feb 2016 17:22:15 -0500 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 Received: from SN1NAM02FT025.eop-nam02.prod.protection.outlook.com (10.152.72.60) by SN1NAM02HT009.eop-nam02.prod.protection.outlook.com (10.152.72.210) with Microsoft SMTP Server (TLS) id 15.1.409.7; Tue, 9 Feb 2016 22:17:32 +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 SN1NAM02FT025.mail.protection.outlook.com (10.152.72.87) with Microsoft SMTP Server (TLS) id 15.1.409.7 via Frontend Transport; Tue, 9 Feb 2016 22:17:32 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:35371 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aTGbD-0002mg-Sn; Tue, 09 Feb 2016 14:17:31 -0800 Received: from [127.0.0.1] (port=42590 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aTGbD-0007ae-Mu; Tue, 09 Feb 2016 14:17:31 -0800 Received: from xsj-tvapsmtp02 (xsj-tvapsmtp02.xilinx.com [172.16.1.203]) by tsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id u19MBpUa011566; Tue, 9 Feb 2016 14:11:51 -0800 Received: from [172.19.74.182] (port=49726 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aTGbC-0007ab-Pn; Tue, 09 Feb 2016 14:17:30 -0800 From: Alistair Francis To: , Date: Tue, 9 Feb 2016 14:14:55 -0800 Message-ID: <889f6c7641bb04403de2a03406177dcf24ca8a53.1455055858.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22054.006 X-TM-AS-Result: No--3.678-7.0-31-10 X-imss-scan-details: No--3.678-7.0-31-10 X-TMASE-MatchedRID: 1+eTE4anhiQD2WXLXdz+Ae3+iQEtoSj4wc9gNHV999+jxYyRBa/qJQJj 6WxgWJYb5MIx11wv+CPGVuWouVipclV5ZwmmXAMbcwqnarAEnpteSLVBjHVUFF8LTjLZ97WXzt1 5Ld/2yUak07fZjOlGWkvMiDwAkWzPMCt7oHqwXlcOfPb1Cbbiv/6/2/nZkihaOgB/fz3EXdcVKT 0eFRmfDs4YhafCzgujIdY9jOi4lTI= X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.96; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(105606002)(77096005)(2950100001)(229853001)(33646002)(19580395003)(50466002)(5003940100001)(6806005)(106466001)(2906002)(118296001)(85426001)(87936001)(19580405001)(5003600100002)(50226001)(36756003)(11100500001)(86362001)(47776003)(48376002)(4326007)(92566002)(64026002)(586003)(189998001)(1096002)(50986999)(76176999)(1220700001)(5001770100001)(5001960100002)(5008740100001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT009; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 4b35a7db-fdd4-4b3e-2800-08d3319ece7d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT009; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13018025)(13017025)(8121501046)(5005006)(13015025)(13023025)(3002001)(10201501046); SRVR:SN1NAM02HT009; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT009; X-Forefront-PRVS: 08476BC6EF X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2016 22:17:32.5305 (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: SN1NAM02HT009 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.80 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 Subject: [Qemu-devel] [PATCH v4 08/16] bitops: Add ONES macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org 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 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