summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2016-02-10 11:07:04 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:41:57 -0600
commite0cd36c2bc151e3141cde7d9a82580e22c564d10 (patch)
treeb3f986067d738ae654d5cfd7d96bacf254b55fb3 /include
parent42f5b7c450ba9a6a64fd8dae353ea54a41b2a8ed (diff)
downloadhqemu-e0cd36c2bc151e3141cde7d9a82580e22c564d10.zip
hqemu-e0cd36c2bc151e3141cde7d9a82580e22c564d10.tar.gz
xen: move xenforeignmemory compat layer into common place
Now that we no longer support Xen 4.2 and earlier only the <470 case needs this so it can live with all the others. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/xen/xen_common.h34
1 files changed, 14 insertions, 20 deletions
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 254ef14..7a3cce0 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -53,7 +53,20 @@ typedef xc_gnttab xengnttab_handle;
#define xengnttab_map_grant_refs(h, c, d, r, p) \
xc_gnttab_map_grant_refs(h, c, d, r, p)
-/* See below for xenforeignmemory_* APIs */
+#define xenforeignmemory_open(l, f) xen_xc
+
+static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
+ int prot, size_t pages,
+ const xen_pfn_t arr[/*pages*/],
+ int err[/*pages*/])
+{
+ if (err)
+ return xc_map_foreign_bulk(h, dom, prot, arr, err, pages);
+ else
+ return xc_map_foreign_pages(h, dom, prot, arr, pages);
+}
+
+#define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
@@ -359,23 +372,4 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
#endif
#endif
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
-
-#define xenforeignmemory_open(l, f) xen_xc
-
-static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
- int prot, size_t pages,
- const xen_pfn_t arr[/*pages*/],
- int err[/*pages*/])
-{
- if (err)
- return xc_map_foreign_bulk(h, dom, prot, arr, err, pages);
- else
- return xc_map_foreign_pages(h, dom, prot, arr, pages);
-}
-
-#define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
-
-#endif
-
#endif /* QEMU_HW_XEN_COMMON_H */
OpenPOWER on IntegriCloud