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.gr...@arm.com>

---
Cc: Stefano Stabellini <sstabell...@kernel.org>
Cc: Jan Beulich <jbeul...@suse.com>
Cc: Andrew Cooper <andrew.coop...@citrix.com>
Cc: George Dunlap <george.dun...@eu.citrix.com>
Cc: Ian Jackson <ian.jack...@eu.citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: Tim Deegan <t...@xen.org>
Cc: Wei Liu <wei.l...@citrix.com>
---
 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)
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to