aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xg_private.h
diff options
context:
space:
mode:
authorDario Faggioli <dario.faggioli@citrix.com>2013-09-10 19:54:12 +0200
committerIan Campbell <ian.campbell@citrix.com>2013-09-13 13:10:07 +0100
commit266abb240738bb37ccb28623806273c58523f422 (patch)
treee76529b1acdc3a21ebd82fb5d776a45d8c2ba0bc /tools/libxc/xg_private.h
parentdfdfcdc6f7c51ef7e5d0547120d0ac943ef43c67 (diff)
downloadxen-266abb240738bb37ccb28623806273c58523f422.tar.gz
xen-266abb240738bb37ccb28623806273c58523f422.tar.bz2
xen-266abb240738bb37ccb28623806273c58523f422.zip
libxc: introduce xc_map_domain_meminfo (and xc_unmap_domain_meminfo)
And use it in xc_exchange_page(). This is basically because the following change need something really similar to the set of steps that are here abstracted in these two functions. Despite of the change in the interface and in the signature of some functions, this is pure code motion. No functional changes involved. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxc/xg_private.h')
-rw-r--r--tools/libxc/xg_private.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index db02ccf470..5ff2124346 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -136,6 +136,15 @@ struct domain_info_context {
unsigned long p2m_size;
};
+static inline xen_pfn_t pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m, int gwidth)
+{
+ return ((xen_pfn_t) ((gwidth==8)?
+ (((uint64_t *)p2m)[(pfn)]):
+ ((((uint32_t *)p2m)[(pfn)]) == 0xffffffffU ?
+ (-1UL) :
+ (((uint32_t *)p2m)[(pfn)]))));
+}
+
/* Number of xen_pfn_t in a page */
#define FPP (PAGE_SIZE/(dinfo->guest_width))