aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen/grant_table.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/xen/grant_table.h')
-rw-r--r--include/xen/grant_table.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index 949803e20872..d3bef563e8da 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -45,6 +45,8 @@
45#include <asm/xen/hypervisor.h> 45#include <asm/xen/hypervisor.h>
46 46
47#include <xen/features.h> 47#include <xen/features.h>
48#include <linux/mm_types.h>
49#include <linux/page-flags.h>
48 50
49#define GNTTAB_RESERVED_XENSTORE 1 51#define GNTTAB_RESERVED_XENSTORE 1
50 52
@@ -185,4 +187,22 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
185void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count); 187void gnttab_batch_map(struct gnttab_map_grant_ref *batch, unsigned count);
186void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count); 188void gnttab_batch_copy(struct gnttab_copy *batch, unsigned count);
187 189
190
191struct xen_page_foreign {
192 domid_t domid;
193 grant_ref_t gref;
194};
195
196static inline struct xen_page_foreign *xen_page_foreign(struct page *page)
197{
198 if (!PageForeign(page))
199 return NULL;
200#if BITS_PER_LONG < 64
201 return (struct xen_page_foreign *)page->private;
202#else
203 BUILD_BUG_ON(sizeof(struct xen_page_foreign) > BITS_PER_LONG);
204 return (struct xen_page_foreign *)&page->private;
205#endif
206}
207
188#endif /* __ASM_GNTTAB_H__ */ 208#endif /* __ASM_GNTTAB_H__ */