Message ID | 1465906027-16614-8-git-send-email-julien.grall@arm.com |
---|---|
State | New |
Headers | show
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: <xen-devel-bounces@lists.xen.org> 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 <xen-devel-bounces@lists.xen.org>) 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 <julien.grall@arm.com>) 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 <julien.grall@arm.com> 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 <wei.liu2@citrix.com>, George Dunlap <george.dunlap@eu.citrix.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>, Julien Grall <julien.grall@arm.com>, Jan Beulich <jbeulich@suse.com>, 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 <xen-devel.lists.xen.org> List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=unsubscribe> List-Post: <mailto:xen-devel@lists.xen.org> List-Help: <mailto:xen-devel-request@lists.xen.org?subject=help> List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xen.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" <xen-devel-bounces@lists.xen.org> |
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)
Those helpers will be useful to find the maximum/minimum between two GFNs without having to unbox/box manually. Signed-off-by: Julien Grall <julien.grall@arm.com> --- Cc: Stefano Stabellini <sstabellini@kernel.org> Cc: Jan Beulich <jbeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: George Dunlap <george.dunlap@eu.citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Tim Deegan <tim@xen.org> Cc: Wei Liu <wei.liu2@citrix.com> --- xen/include/xen/mm.h | 3 +++ 1 file changed, 3 insertions(+)