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: 69990 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2011527qgf; Tue, 14 Jun 2016 05:08:49 -0700 (PDT) X-Received: by 10.176.4.49 with SMTP id 46mr6824111uav.32.1465906127128; Tue, 14 Jun 2016 05:08:47 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id y1si3176687vky.187.2016.06.14.05.08.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jun 2016 05:08:47 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org 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" 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)