From patchwork Tue Jun 14 12:07:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9175695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F1C3F60772 for ; Tue, 14 Jun 2016 12:09:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E33FA24151 for ; Tue, 14 Jun 2016 12:09:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D85E2280E0; Tue, 14 Jun 2016 12:09:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2B0D24151 for ; Tue, 14 Jun 2016 12:09:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCn7z-00050H-CA; Tue, 14 Jun 2016 12:07:31 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCn7x-0004xh-RB for xen-devel@lists.xen.org; Tue, 14 Jun 2016 12:07:29 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 11/36-31810-083FF575; Tue, 14 Jun 2016 12:07:28 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRWlGSWpSXmKPExsVysyfVTbfhc3y 4wcx96hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8biHpeCN+wVPZeusjcwPmHrYuTiEBLYxCgx 7+5xdgjnNKPEt8OrWLoYOTnYBDQl7nz+xARiiwhIS1z7fJkRpIhZ4AWTxIQjt8GKhAWsJI7Pe AE0ioODRUBV4tW1PBCTV8BFYsdBLpAKCQE5iZPHJrOChDkFXCXuThEGCQsBVcxsmcU4gZF7AS PDKkb14tSistQiXWO9pKLM9IyS3MTMHF1DA2O93NTi4sT01JzEpGK95PzcTYxAzzIAwQ7G5i9 OhxglOZiURHlvT4wPF+JLyk+pzEgszogvKs1JLT7EKMPBoSTBu+QTUE6wKDU9tSItMwcYYjBp CQ4eJRHehSBp3uKCxNzizHSI1ClGRSlx3o0gCQGQREZpHlwbLKwvMcpKCfMyAh0ixFOQWpSbW YIq/4pRnINRSZh3KcgUnsy8Erjpr4AWMwEttpkOtrgkESEl1cAYHVVeYry3/dGkPT3xdfO1wr 7tkmjf7zJlPcPuR+2iJ/bf7f1fqR6VuFfpSO65mUW/n7tMmMadIXiH4dzUyRMZlIL2O5q8vvE weYNCSsS1751bKku59YKuMsd1ONTrGzyUz0mJ7p9b+CFyV9ulBWv/Tb9g/2n+ncDzx6JMly6R +J7UV3Z++9QZSizFGYmGWsxFxYkAl5kh82YCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1465906048!8644424!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9960 invoked from network); 14 Jun 2016 12:07:28 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-9.tower-31.messagelabs.com with SMTP; 14 Jun 2016 12:07:28 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1FFDD707; Tue, 14 Jun 2016 05:08:08 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2DE523F246; Tue, 14 Jun 2016 05:07:26 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 14 Jun 2016 13:07:06 +0100 Message-Id: <1465906027-16614-8-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465906027-16614-1-git-send-email-julien.grall@arm.com> References: <1465906027-16614-1-git-send-email-julien.grall@arm.com> Cc: sstabellini@kernel.org, Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , wei.chen@linaro.org Subject: [Xen-devel] [PATCH 7/8] xen/mm: Introduce max_gfn and min_gfn X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Those helpers will be useful to find the maximum/minimum between two GFNs without having to unbox/box manually. Signed-off-by: Julien Grall --- Cc: Stefano Stabellini Cc: Jan Beulich Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Konrad Rzeszutek Wilk Cc: Tim Deegan Cc: Wei Liu --- xen/include/xen/mm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index a22c4c2..6fddb6f 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -70,6 +70,9 @@ TYPE_SAFE(unsigned long, gfn); #undef gfn_t #endif +#define max_gfn(x, y) _gfn(max(gfn_x(x), gfn_x(y))) +#define min_gfn(x, y) _gfn(min(gfn_x(x), gfn_x(y))) + TYPE_SAFE(unsigned long, pfn); #define PRI_pfn "05lx" #define INVALID_PFN (~0UL)