diff mbox

[Xen-devel,7/8] xen/mm: Introduce max_gfn and min_gfn

Message ID 1465906027-16614-8-git-send-email-julien.grall@arm.com
State New
Headers show

Commit Message

Julien Grall June 14, 2016, 12:07 p.m. UTC
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(+)
diff mbox

Patch

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)