From patchwork Sat Jan 30 01:01:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 575903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AD160140BE7 for ; Sat, 30 Jan 2016 12:09:57 +1100 (AEDT) Received: from localhost ([::1]:37246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPK31-0007WJ-GL for incoming@patchwork.ozlabs.org; Fri, 29 Jan 2016 20:09:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJx3-0004uY-UI for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPJwz-00085A-3Z for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:45 -0500 Received: from mail-sn1nam02on0066.outbound.protection.outlook.com ([104.47.36.66]:56240 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPJwy-000850-Uf for qemu-devel@nongnu.org; Fri, 29 Jan 2016 20:03:41 -0500 Received: from SN1NAM02HT239.eop-nam02.prod.protection.outlook.com (10.152.73.83) by SN1NAM02HT156.eop-nam02.prod.protection.outlook.com (10.152.72.181) with Microsoft SMTP Server (TLS) id 15.1.355.15; Sat, 30 Jan 2016 01:03:40 +0000 Received: from SN1NAM02FT007.eop-nam02.prod.protection.outlook.com (10.152.72.56) by SN1NAM02HT239.eop-nam02.prod.protection.outlook.com (10.152.73.83) with Microsoft SMTP Server (TLS) id 15.1.355.15; Sat, 30 Jan 2016 01:03:39 +0000 Authentication-Results: spf=fail (sender IP is 149.199.60.96) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none; suse.de; 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 SN1NAM02FT007.mail.protection.outlook.com (10.152.72.88) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Sat, 30 Jan 2016 01:03:39 +0000 Received: from 172-16-1-203.xilinx.com ([172.16.1.203]:45486 helo=xsj-tvapsmtp02.xilinx.com) by xsj-tvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1aPJww-0002Nc-6L; Fri, 29 Jan 2016 17:03:38 -0800 Received: from [127.0.0.1] (port=52705 helo=tsj-smtp-dlp1.xlnx.xilinx.com) by xsj-tvapsmtp02.xilinx.com with esmtp (Exim 4.63) (envelope-from ) id 1aPJww-0002uE-1I; Fri, 29 Jan 2016 17:03:38 -0800 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 u0U0w1ZA022056; Fri, 29 Jan 2016 16:58:01 -0800 Received: from [172.19.74.182] (port=49978 helo=xsjalistai50.xlnx.xilinx.com) by xsj-tvapsmtp02 with esmtp (Exim 4.63) (envelope-from ) id 1aPJwv-0002u8-3o; Fri, 29 Jan 2016 17:03:37 -0800 From: Alistair Francis To: , , Date: Fri, 29 Jan 2016 17:01:01 -0800 Message-ID: <3d56c242029f87888361ccc59db6270ccaabd442.1454115217.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)(979002)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(50466002)(77096005)(50226001)(106466001)(1220700001)(5003940100001)(5001960100002)(2950100001)(85426001)(189998001)(36756003)(6806005)(11100500001)(50986999)(105606002)(47776003)(586003)(64026002)(5008740100001)(3470700001)(229853001)(71366001)(19580405001)(2201001)(5001770100001)(1096002)(5003600100002)(118296001)(76176999)(19580395003)(4326007)(2906002)(33646002)(86362001)(48376002)(92566002)(87936001)(107986001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1NAM02HT239; H:xsj-tvapsmtpgw01; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:unknown-60-96.xilinx.com; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e2cb64de-d6e1-41ed-3dd9-08d32911306e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT239; X-Microsoft-Antispam-PRVS: <27a4f3e2e49345c5b67dc5d636c842fe@SN1NAM02HT239.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(13017025)(5005006)(8121501046)(13018025)(13015025)(13024025)(3002001)(10201501046); SRVR:SN1NAM02HT239; BCL:0; PCL:0; RULEID:; SRVR:SN1NAM02HT239; X-Forefront-PRVS: 083751FCA6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2016 01:03:39.0429 (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: SN1NAM02HT239 X-OriginatorOrg: xilinx.com X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.66 Cc: edgar.iglesias@xilinx.com, edgar.iglesias@gmail.com, crosthwaitepeter@gmail.com, afaerber@suse.de, alistair.francis@xilinx.com Subject: [Qemu-devel] [PATCH v3 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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