1 #ifndef _XEN_P2M_COMMON_H
2 #define _XEN_P2M_COMMON_H
3 
4 #include <xen/mm-frame.h>
5 
6 /* Set foreign entry in the p2m table */
7 int set_foreign_p2m_entry(struct domain *d, const struct domain *fd,
8                           unsigned long gfn, mfn_t mfn);
9 
10 /* Remove a page from a domain's p2m table */
11 int __must_check
12 guest_physmap_remove_page(struct domain *d, gfn_t gfn, mfn_t mfn,
13                           unsigned int page_order);
14 
15 /* Map MMIO regions in the p2m: start_gfn and nr describe the range in
16  *  * the guest physical address space to map, starting from the machine
17  *   * frame number mfn. */
18 int map_mmio_regions(struct domain *d,
19                      gfn_t start_gfn,
20                      unsigned long nr,
21                      mfn_t mfn);
22 int unmap_mmio_regions(struct domain *d,
23                        gfn_t start_gfn,
24                        unsigned long nr,
25                        mfn_t mfn);
26 
27 /*
28  * Populate-on-Demand
29  */
30 
31 /*
32  * Call when decreasing memory reservation to handle PoD entries properly.
33  * Returns the number of pages that were successfully processed.
34  */
35 unsigned long
36 p2m_pod_decrease_reservation(struct domain *d, gfn_t gfn,
37                              unsigned int order);
38 
39 int __must_check check_get_page_from_gfn(struct domain *d, gfn_t gfn,
40                                          bool readonly, p2m_type_t *p2mt_p,
41                                          struct page_info **page_p);
42 
43 
44 #endif /* _XEN_P2M_COMMON_H */
45